[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20070410204527.GB5840@martell.zuzino.mipt.ru>
Date: Wed, 11 Apr 2007 00:45:27 +0400
From: Alexey Dobriyan <adobriyan@...il.com>
To: Jeremy Fitzhardinge <jeremy@...p.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
"Robert P. J. Day" <rpjday@...dspring.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Add spaces on either side of case "..." operator.
On Tue, Apr 10, 2007 at 10:47:21AM -0700, Jeremy Fitzhardinge wrote:
> Andrew Morton wrote:
> > #define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
> > #define AUDIT_USER_AVC 1107 /* We filter this differently */
> > #define AUDIT_LAST_USER_MSG 1199
> >
> > and CPP turns that into
> >
> > case 1100 ...1199:
> > case 2100 ...2999:
> >
> > and it does the same when the comments are stripped from the #defines.
> >
> > So we were saved by the trailing space which cpp added to the expanded
> > macro. I wonder why cpp did that, and to what extent one can rely cpp
> > doing that.
>
> I think its required to. If it didn't, it would be effectively pasting
> two tokens together without the ## operator.
Internally, there are lists of tokens and no ambiguities. What gcc docs
warn about is that
case 1...2:
will be parsed as
case
[space]
1.
.
.2
:
which won't fly.
> But putting spaces in is safer - or putting () around the numbers.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists