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

2015-04-28 Thread Kalle Valo
Rasmus Villemoes li...@rasmusvillemoes.dk 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

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 li...@rasmusvillemoes.dk 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

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[] = a

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

2015-02-13 Thread Rasmus Villemoes
On Fri, Feb 13 2015, David Laight david.lai...@aculab.com 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

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

2015-02-12 Thread Rasmus Villemoes
On Thu, Feb 12 2015, Rustad, Mark D mark.d.rus...@intel.com wrote: On Feb 11, 2015, at 2:51 PM, Rasmus Villemoes li...@rasmusvillemoes.dk 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

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

[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