This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Volatile constants?
- To: gcc at gcc dot gnu dot org
- Subject: Re: Volatile constants?
- From: Andi Kleen <ak at suse dot de>
- Date: 29 Mar 2000 23:17:58 +0200
- Cc: kth at srv dot net, 97nv46 at skola dot kiruna dot se
- References: <s8e219aa.038@ymer> <38E17D41.4F23F10F@srv.net>
Kevin Handy <kth@srv.net> writes:
>
> After preprocess
>
> int s = (-7<0 ? --7 : -7)
>
> I'd guess that the decrement '--7' is what is causing you the problem
> This is why you should always use extra parentheses in your #defines
This is not true. ANSI-C generates tokens before preprocessing.
The tokens are not concatenated afterwards, unless you use ##
It should be parsed as - - 7, which is legal C. Maybe some prehistoric
K&R preprocessors do it differently.
The problem is just that inline calls are not allowed in constant
expressions, and a global definition expects a constant expression
as initializer. inline does not change the grammar here.
-Andi