Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-05 Thread Richard Biener
On Mon, 4 Jul 2016, Martin Sebor wrote: > On 07/04/2016 04:59 AM, Richard Biener wrote: > > On Fri, 1 Jul 2016, Martin Sebor wrote: > > > > > The attached patch enhances compile-time checking for buffer overflow > > > and output truncation in non-trivial calls to the sprintf family of > > >

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Martin Sebor
On 07/04/2016 10:44 AM, Jakub Jelinek wrote: On Mon, Jul 04, 2016 at 10:23:06AM -0600, Martin Sebor wrote: 1) Making use of -Wformat machinery in c-family/c-format.c. This seemed preferable to duplicating some of the same code elsewhere (I initially started implementing it in

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Bernd Schmidt
On 07/04/2016 06:44 PM, Jakub Jelinek wrote: On Mon, Jul 04, 2016 at 10:23:06AM -0600, Martin Sebor wrote: No, it doesn't. What I meant is that the same code, when added in builtins.c instead, could readily be extended to fold into strings expressions like sprintf (buf, "%i", 123); I've

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Jakub Jelinek
On Mon, Jul 04, 2016 at 10:23:06AM -0600, Martin Sebor wrote: > >>1) Making use of -Wformat machinery in c-family/c-format.c. This > >>seemed preferable to duplicating some of the same code elsewhere > >>(I initially started implementing it in expand_builtin in > >>builtins.c). It

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Martin Sebor
On 07/04/2016 04:59 AM, Richard Biener wrote: On Fri, 1 Jul 2016, Martin Sebor wrote: The attached patch enhances compile-time checking for buffer overflow and output truncation in non-trivial calls to the sprintf family of functions under a new option -Wformat-length=[12]. This initial patch

Re: [PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-04 Thread Richard Biener
On Fri, 1 Jul 2016, Martin Sebor wrote: > The attached patch enhances compile-time checking for buffer overflow > and output truncation in non-trivial calls to the sprintf family of > functions under a new option -Wformat-length=[12]. This initial > patch handles printf directives with string,

[PATCH] - improve sprintf buffer overflow detection (middle-end/49905)

2016-07-01 Thread Martin Sebor
The attached patch enhances compile-time checking for buffer overflow and output truncation in non-trivial calls to the sprintf family of functions under a new option -Wformat-length=[12]. This initial patch handles printf directives with string, integer, and simple floating arguments but

<    1   2