Re: [PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-20 Thread Josh Triplett
On Sun, Nov 17, 2013 at 09:07:46PM -0500, Greg Price wrote: > From: Greg Price > Date: Sun, 17 Nov 2013 17:57:41 -0800 > Subject: [PATCH] Clarify error on directive in macro arguments > > Preprocessor directives in the arguments of a real function > are innocuous and in some contexts common. If

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-20 Thread Josh Triplett
On Mon, Nov 18, 2013 at 01:33:49AM +, Al Viro wrote: > On Sun, Nov 17, 2013 at 02:45:05PM -0800, Joe Perches wrote: > > On Sun, 2013-11-17 at 20:34 -0200, Erico Nunes wrote: > > > Do you mean it as an error in the sparse tool? > > > > Yes. I think it's a defect in how sparse > > treats string

Re: [PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-17 Thread Greg Price
On Sun, Nov 17, 2013 at 06:15:32PM -0800, Joe Perches wrote: > On Sun, 2013-11-17 at 21:07 -0500, Greg Price wrote: > > Perhaps the following tweak to the error message would make this > > subtlety clearer? > > Maybe, but this case isn't a macro. It's a function. > Dunno if differentiating when i

Re: [PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-17 Thread Al Viro
On Sun, Nov 17, 2013 at 06:15:32PM -0800, Joe Perches wrote: > > > sparse matches gcc behaviour (I hope), but it warns about such abuses. > > > It's a defect, all right - one being reported by sparse. > > > > Perhaps the following tweak to the error message would make this > > subtlety clearer? >

Re: [PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-17 Thread Erico Nunes
On Mon, Nov 18, 2013 at 12:15 AM, Joe Perches wrote: > On Sun, 2013-11-17 at 21:07 -0500, Greg Price wrote: > > Maybe, but this case isn't a macro. It's a function. > Dunno if differentiating when it's a macro or a > function is difficult though. > > The case which was initially reported by spar

Re: [PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-17 Thread Joe Perches
On Sun, 2013-11-17 at 21:07 -0500, Greg Price wrote: > [+linux-sparse and Chris] > > On Mon, Nov 18, 2013 at 01:33:49AM +, Al Viro wrote: > > On Sun, Nov 17, 2013 at 02:45:05PM -0800, Joe Perches wrote: > > > Yes. I think it's a defect in how sparse > > > treats string concatenation. > > > >

[PATCH] Clarify error on directive in macro arguments (Re: [PATCH] jffs2: fix sparse errors: directive in argument list)

2013-11-17 Thread Greg Price
[+linux-sparse and Chris] On Mon, Nov 18, 2013 at 01:33:49AM +, Al Viro wrote: > On Sun, Nov 17, 2013 at 02:45:05PM -0800, Joe Perches wrote: > > Yes. I think it's a defect in how sparse > > treats string concatenation. > > > > That style [... with printk ...] is pretty common in the kernel

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Al Viro
On Sun, Nov 17, 2013 at 02:45:05PM -0800, Joe Perches wrote: > On Sun, 2013-11-17 at 20:34 -0200, Erico Nunes wrote: > > Do you mean it as an error in the sparse tool? > > Yes. I think it's a defect in how sparse > treats string concatenation. > > That style: > > printk("%s\n", > #ifdef F

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Richard Weinberger
On Sun, Nov 17, 2013 at 11:45 PM, Joe Perches wrote: > On Sun, 2013-11-17 at 20:34 -0200, Erico Nunes wrote: >> Do you mean it as an error in the sparse tool? > > Yes. I think it's a defect in how sparse > treats string concatenation. > > That style: > > printk("%s\n", > #ifdef FOO >

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Joe Perches
On Sun, 2013-11-17 at 20:34 -0200, Erico Nunes wrote: > Do you mean it as an error in the sparse tool? Yes. I think it's a defect in how sparse treats string concatenation. That style: printk("%s\n", #ifdef FOO "foo" #endif #ifdef BAR "bar" #endif "string"); is

[PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Erico Nunes
This patch fixes the following errors reported when running sparse: fs/jffs2/super.c:378:1: error: directive in argument list fs/jffs2/super.c:380:1: error: directive in argument list fs/jffs2/super.c:381:1: error: directive in argument list fs/jffs2/super.c:383:1: error: directive in argument list

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Erico Nunes
Thanks for your reply. I'll resubmit shortly. Do you mean it as an error in the sparse tool? I don't think so, I took a look and it seems to be designed to output an error for that case. On Sun, Nov 17, 2013 at 7:40 PM, Joe Perches wrote: > On Sun, 2013-11-17 at 18:18 -0200, Erico Nunes wrote:

Re: [PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Joe Perches
On Sun, 2013-11-17 at 18:18 -0200, Erico Nunes wrote: > This patch fixes the following errors reported when running sparse: > fs/jffs2/super.c:378:1: error: directive in argument list > fs/jffs2/super.c:380:1: error: directive in argument list > fs/jffs2/super.c:381:1: error: directive in argument

[PATCH] jffs2: fix sparse errors: directive in argument list

2013-11-17 Thread Erico Nunes
This patch fixes the following errors reported when running sparse: fs/jffs2/super.c:378:1: error: directive in argument list fs/jffs2/super.c:380:1: error: directive in argument list fs/jffs2/super.c:381:1: error: directive in argument list fs/jffs2/super.c:383:1: error: directive in argument list