[PATCH 2/3] Add DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION

Pedro Alves palves@redhat.com
Mon Jun 4 12:19:00 GMT 2018


On 06/04/2018 01:13 PM, Nick Clifton wrote:
> Hi H.J.
> 
>> +# if __GNUC__ == 8 && __GNUC_MINOR__ < 2
>> +#  define DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION \
>> +  DIAGNOSTIC_IGNORE ("-Wstringop-truncation")
>> +# endif
>>
>> OK for master?
> 
> Approved - please apply.

Please don't.  This is again going against the intention of
the header.  The GCC version checks should be put in the
places where the warning needs to be suppressed.
The current patch makes all current and future uses of
DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION only apply to
GCC 8.1.  That is incorrect.  Consider what you will
have to do to suppress some -Wstrinop-truncation warning
with DIAGNOSTIC_IGNORE_STRINGOP_TRUNCATION on GCC 8.2 or
GCC 9 or whatever.

Also, you can use GCC_VERSION to make the version check
a little simpler.

Thanks,
Pedro Alves



More information about the Gdb-patches mailing list