Re: [PATCH] iwl4965: Enable checking of format strings

2015-04-28 Thread Stanislaw Gruszka
On Tue, Apr 28, 2015 at 07:19:02PM +0300, Kalle Valo wrote: > Rasmus Villemoes writes: > > > Since these fmt_* variables are just const char*, and not const > > char[], gcc (and smatch) doesn't to type checking of the arguments to > > the printf functions. Since the linker knows perfectly well to

Re: [PATCH] iwl4965: Enable checking of format strings

2015-04-28 Thread Kalle Valo
Rasmus Villemoes writes: > Since these fmt_* variables are just const char*, and not const > char[], gcc (and smatch) doesn't to type checking of the arguments to > the printf functions. Since the linker knows perfectly well to merge > identical string constants, there's no point in having three

Re: [PATCH] iwl4965: Enable checking of format strings

2015-02-13 Thread Rasmus Villemoes
On Fri, Feb 13 2015, David Laight wrote: > From: Rasmus Villemoes >> Well, probably the linker is allowed to overlap "anonymous" objects >> (string literals) with whatever const char[] (or indeed any const) >> object it finds containing the appropriate byte sequence. But I think >> language lawye

RE: [PATCH] iwl4965: Enable checking of format strings

2015-02-13 Thread David Laight
From: Rasmus Villemoes > Well, probably the linker is allowed to overlap "anonymous" objects > (string literals) with whatever const char[] (or indeed any const) > object it finds containing the appropriate byte sequence. But I think > language lawyers would insist that for > > const char foo[] =

Re: [PATCH] iwl4965: Enable checking of format strings

2015-02-13 Thread Rasmus Villemoes
On Fri, Feb 13 2015, Mark Rustad wrote: > On 2/12/15 2:20 AM, Rasmus Villemoes wrote: >> Rather weak arguments, but I have three of them :-) > > Yes, weak. All three. > >> (1) If I'm reading some code and spot a non-constant format >> argument, I sometimes track back to see how e.g. fmt_value is

Re: [PATCH] iwl4965: Enable checking of format strings

2015-02-12 Thread Mark Rustad
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 2/12/15 2:20 AM, Rasmus Villemoes wrote: > Rather weak arguments, but I have three of them :-) Yes, weak. All three. > (1) If I'm reading some code and spot a non-constant format > argument, I sometimes track back to see how e.g. fmt_value is > de

Re: [PATCH] iwl4965: Enable checking of format strings

2015-02-12 Thread Rasmus Villemoes
On Thu, Feb 12 2015, "Rustad, Mark D" wrote: > On Feb 11, 2015, at 2:51 PM, Rasmus Villemoes > wrote: > >> Since these fmt_* variables are just const char*, and not const >> char[], gcc (and smatch) doesn't to type checking of the arguments to >> the printf functions. Since the linker knows per

Re: [PATCH] iwl4965: Enable checking of format strings

2015-02-11 Thread Rustad, Mark D
On Feb 11, 2015, at 2:51 PM, Rasmus Villemoes wrote: > Since these fmt_* variables are just const char*, and not const > char[], gcc (and smatch) doesn't to type checking of the arguments to > the printf functions. Since the linker knows perfectly well to merge > identical string constants, there

[PATCH] iwl4965: Enable checking of format strings

2015-02-11 Thread Rasmus Villemoes
Since these fmt_* variables are just const char*, and not const char[], gcc (and smatch) doesn't to type checking of the arguments to the printf functions. Since the linker knows perfectly well to merge identical string constants, there's no point in having three static pointers waste memory and gi