Re: [PATCH] avoid bogus -Wstringop-overflow for strncpy with _FORTIFY_SOURCE (PR 82646)

2017-12-08 Thread Christophe Lyon
On 7 December 2017 at 20:28, Martin Sebor wrote: > On 12/07/2017 06:46 AM, Christophe Lyon wrote: >> >> Hi Martin, >> >> >> On 6 December 2017 at 00:51, Jeff Law wrote: >>> >>> On 12/05/2017 04:47 PM, Martin Sebor wrote: PR middle-end/82646 - bogus -Wstringop-overflow with -D_FORTI

Re: [PATCH] avoid bogus -Wstringop-overflow for strncpy with _FORTIFY_SOURCE (PR 82646)

2017-12-07 Thread Martin Sebor
On 12/07/2017 06:46 AM, Christophe Lyon wrote: Hi Martin, On 6 December 2017 at 00:51, Jeff Law wrote: On 12/05/2017 04:47 PM, Martin Sebor wrote: PR middle-end/82646 - bogus -Wstringop-overflow with -D_FORTIFY_SOURCE=2 on strncpy with range to a member array, The bug points out a false pos

Re: [PATCH] avoid bogus -Wstringop-overflow for strncpy with _FORTIFY_SOURCE (PR 82646)

2017-12-07 Thread Christophe Lyon
Hi Martin, On 6 December 2017 at 00:51, Jeff Law wrote: > On 12/05/2017 04:47 PM, Martin Sebor wrote: >> PR middle-end/82646 - bogus -Wstringop-overflow with >> -D_FORTIFY_SOURCE=2 on strncpy with range to a member array, >> >> The bug points out a false positive in a call to strncpy() when >> _

Re: [PATCH] avoid bogus -Wstringop-overflow for strncpy with _FORTIFY_SOURCE (PR 82646)

2017-12-05 Thread Jeff Law
On 12/05/2017 04:47 PM, Martin Sebor wrote: > PR middle-end/82646 - bogus -Wstringop-overflow with > -D_FORTIFY_SOURCE=2 on strncpy with range to a member array, > > The bug points out a false positive in a call to strncpy() when > _FORTIFY_SOURCE is defined that doesn't exist otherwise. > > The 

[PATCH] avoid bogus -Wstringop-overflow for strncpy with _FORTIFY_SOURCE (PR 82646)

2017-12-05 Thread Martin Sebor
PR middle-end/82646 - bogus -Wstringop-overflow with -D_FORTIFY_SOURCE=2 on strncpy with range to a member array, The bug points out a false positive in a call to strncpy() when _FORTIFY_SOURCE is defined that doesn't exist otherwise. The problem is that __builtin_strncpy buffer overflow checkin