On 04/12/2018 06:02 PM, Martin Sebor wrote:
> Attached is a minor update that avoids additional duplicate
> warnings exposed by more extensive testing (for PR 85369).
> 
> On 04/12/2018 02:52 PM, Martin Sebor wrote:
>> The attached patch makes a small tweak to avoid issuing a duplicate
>> warning for calls to strcmp with a nonstring argument.  The most
>> onerous part of this was figuring out how to test for the absence
>> of duplicate warnings.  The "hack" I used (dg-regexp) is in place
>> until a more straightforward solution becomes available.  (David
>> Malcolm has something planned for GCC 9.)
>>
>> Martin
> 
> 
> gcc-85359.diff
> 
> 
> PR middle-end/85359 - duplicate -Wstringop-overflow for a strcmp call with a 
> nonstring pointer
> 
> gcc/ChangeLog:
> 
>       PR middle-end/85359
>       * builtins.c (expand_builtin_strcpy): Call maybe_warn_nonstring_arg
>       only when expasion succeeds.
>       (expand_builtin_strcmp): Same.
>       (expand_builtin_strncmp): Same.
> 
> gcc/testsuite/ChangeLog:
> 
>       PR middle-end/85359
>       * gcc.dg/attr-nonstring.c: New test.
OK.
jeff

Reply via email to