From: Mark Wielaard Date: Fri, 16 Nov 2018 08:27:00 +0000 (+0100) Subject: libelf: Mark both fsize and msize with const attribute. X-Git-Tag: elfutils-0.175~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a01938d584b91e747167bb4b3f30ec300c4d6e43;p=thirdparty%2Felfutils.git libelf: Mark both fsize and msize with const attribute. GCC9 -Wmissing-attributes pointed out that although we alias the fsize and msize functions only fsize was marked as const. Fix by also marking the msize definition as const. https://sourceware.org/bugzilla/show_bug.cgi?id=23884 Signed-off-by: Mark Wielaard --- diff --git a/libelf/ChangeLog b/libelf/ChangeLog index 93820d19f..68c4fbdde 100644 --- a/libelf/ChangeLog +++ b/libelf/ChangeLog @@ -1,3 +1,8 @@ +2018-11-16 Mark Wielaard + + * libebl.h (__elf32_msize): Mark with const attribute. + (__elf64_msize): Likewise. + 2018-11-13 Mark Wielaard * elf_getdata.c (__libelf_set_rawdata_wrlock): Explicitly set the diff --git a/libelf/libelfP.h b/libelf/libelfP.h index fa6d55d8a..9f3e8e9df 100644 --- a/libelf/libelfP.h +++ b/libelf/libelfP.h @@ -461,9 +461,9 @@ extern Elf_Type __libelf_data_type (Elf *elf, int sh_type, GElf_Xword align) These functions cannot be marked internal since they are aliases of the export elfXX_fsize functions.*/ extern size_t __elf32_msize (Elf_Type __type, size_t __count, - unsigned int __version); + unsigned int __version) __const_attribute__; extern size_t __elf64_msize (Elf_Type __type, size_t __count, - unsigned int __version); + unsigned int __version) __const_attribute__; /* Create Elf descriptor from memory image. */