Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-19 Thread Jakub Jelinek
On Mon, Dec 19, 2016 at 01:24:34PM -0700, Jeff Law wrote: > > PR middle-end/78519 - missing warning for sprintf %s with null pointer > > > > gcc/ChangeLog: > > > > PR middle-end/78519 > > * gimple-ssa-sprintf.c (format_string): Handle null pointers. > > (format_directive): Diagnose

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-19 Thread Jeff Law
On 12/14/2016 09:21 PM, Martin Sebor wrote: I suppose setting a range seemed better than giving up. Then again, since with this patch GCC will warn on null %s pointers there may not be much point in trying to see if there's also some other problem after that, except perhaps in code that

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-14 Thread Jeff Law
On 12/14/2016 09:21 PM, Martin Sebor wrote: I suppose setting a range seemed better than giving up. Then again, since with this patch GCC will warn on null %s pointers there may not be much point in trying to see if there's also some other problem after that, except perhaps in code that

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-14 Thread Martin Sebor
I suppose setting a range seemed better than giving up. Then again, since with this patch GCC will warn on null %s pointers there may not be much point in trying to see if there's also some other problem after that, except perhaps in code that deliberately relies on the Glibc feature. I'd be

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-12 Thread Jeff Law
On 12/05/2016 08:56 PM, Martin Sebor wrote: On 12/05/2016 11:21 AM, Jeff Law wrote: On 12/04/2016 04:55 PM, Martin Sebor wrote: Bug 78519 points out that while the -Wformat warning flags a small subset of sprintf calls with a null pointer argument to a %s directive (those where the pointer is

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-05 Thread Martin Sebor
On 12/05/2016 11:21 AM, Jeff Law wrote: On 12/04/2016 04:55 PM, Martin Sebor wrote: Bug 78519 points out that while the -Wformat warning flags a small subset of sprintf calls with a null pointer argument to a %s directive (those where the pointer is a constant) it misses the much bigger set

Re: [PATCH] detect null sprintf pointers (PR 78519)

2016-12-05 Thread Jeff Law
On 12/04/2016 04:55 PM, Martin Sebor wrote: Bug 78519 points out that while the -Wformat warning flags a small subset of sprintf calls with a null pointer argument to a %s directive (those where the pointer is a constant) it misses the much bigger set where the pointer is not a constant but