summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorShin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>2019-06-15 16:00:55 +0900
committerBrian C. Lane <bcl@redhat.com>2019-08-09 11:54:54 -0700
commit76c02fe44a2dddbd615b3ad348f09f0015a34a60 (patch)
tree7644eff5d230c28bdec6d8b54a6b2cd51eee5ed9 /include
parent7a79fa361e51857a8335b28fbea066abf9984a61 (diff)
downloadparted-76c02fe44a2dddbd615b3ad348f09f0015a34a60.tar.gz
include/parted/unit.in.h: Specify const attribute to ped_unit_get_name()
GCC 8 fails to compile libparted/unit.c with an error: CC unit.lo unit.c:155:1: error: function might be candidate for attribute 'const' [-Werror=suggest-attribute=const] ped_unit_get_name (PedUnit unit) ^~~~~~~~~~~~~~~~~ CC disk.lo cc1: all warnings being treated as errors Const attribute is required for the function ped_unit_get_name() because its return value is not affected by program status. To avoid the build failure, change attribute of the function from pure to const. Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp> Signed-off-by: Brian C. Lane <bcl@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/parted/unit.in.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/parted/unit.in.h b/include/parted/unit.in.h
index 315660d..ad8d901 100644
--- a/include/parted/unit.in.h
+++ b/include/parted/unit.in.h
@@ -66,7 +66,7 @@ typedef enum {
extern long long ped_unit_get_size (const PedDevice* dev, PedUnit unit);
extern const char *ped_unit_get_name (PedUnit unit)
- _GL_ATTRIBUTE_PURE;
+ _GL_ATTRIBUTE_CONST;
extern PedUnit ped_unit_get_by_name (const char* unit_name) _GL_ATTRIBUTE_PURE;
extern void ped_unit_set_default (PedUnit unit);