[Skiboot] [PATCH] libflash/ecc: Fix compilation warning
Vasant Hegde
hegdevasant at linux.vnet.ibm.com
Wed Feb 20 15:53:14 AEDT 2019
On 02/19/2019 10:23 AM, Stewart Smith wrote:
> Vasant Hegde <hegdevasant at linux.vnet.ibm.com> writes:
>> We are hitting below warning on gcc9.
>>
>> gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -O2 -Wall -Werror -Wno-stringop-truncation -I. -c libflash/ecc.c -o libflash-ecc.o
>> libflash/ecc.c: In function 'memcpy_to_ecc_unaligned':
>> libflash/ecc.c:419:24: error: taking address of packed member of 'struct ecc64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
>> 419 | memcpy(inc_uint64_by(&ecc_word.data, alignment), src, bytes_wanted);
>> | ^~~~~~~~~~~~~~
>> libflash/ecc.c:448:24: error: taking address of packed member of 'struct ecc64' may result in an unaligned pointer value [-Werror=address-of-packed-member]
>> 448 | memcpy(inc_uint64_by(&ecc_word.data, len), inc_ecc64_by(dst, len),
>> | ^~~~~~~~~~~~~~
>> cc1: all warnings being treated as errors
>
> Interesting warning there... I'm not convinced that uint64_t is really
> the right type to use everywhere, but that's a different patch.
Yeah. may be I should write another patch to cleanup return type, etc.
I will put it in my TODO list.
-Vasant
More information about the Skiboot
mailing list