Related articles |
---|
Pre-Parsers jim.granville@designtools.co.nz (Jim Granville) (2000-09-08) |
Re: Pre-Parsers rhyde@cs.ucr.edu (Randall Hyde) (2000-09-09) |
Re: Pre-Parsers vbdis@aol.com (2000-09-13) |
Re: Pre-Parsers saroj@bear.com (2000-09-15) |
Re: Pre-Parsers vbdis@aol.com (2000-09-21) |
Re: Pre-Parsers broeker@physik.rwth-aachen.de (Hans-Bernhard Broeker) (2000-10-08) |
Re: Pre-Parsers fjh@cs.mu.OZ.AU (2000-10-10) |
Re: Pre-Parsers brynjulv.hauksson@sds.no (2000-10-12) |
Re: Pre-Parsers jthorn@galileo.thp.univie.ac.at (2000-10-12) |
From: | brynjulv.hauksson@sds.no |
Newsgroups: | comp.compilers |
Date: | 12 Oct 2000 21:57:56 -0400 |
Organization: | Interpost |
References: | 00-09-119 00-09-155 00-10-044 |
Keywords: | C, standards |
Hans-Bernhard Broeker <broeker@physik.rwth-aachen.de> writes:
> [Sorry for jumping in so late, on this... ]
>
> > I often found source code with something like:
>
> > #if sizeof(int)==2 ...
>
> > Here sizeof() must be evaluated by the preprocessor.
>
> 'Must' is debatable, here. With equal justification, one could say
> that source that contains such lines 'must' be rejected for being
> incompatible with the definition of the language it's supposed to be
> written in...
> --
> Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
> Even if all the snow were burnt, ashes would remain.
> [What definition would that be? ANSI/ISO C certainly permits sizeof in
> preprocessor expressions. -John]
Maybe I'm missing something obvious here, but in C89 (at least
according to "ANSI and ISO Standard C; Programmer's Reference" by
Plauger & Brodie) you cannot use the sizeof operator in preprocessor
*conditional* excpressions.
-brynjulv
Return to the
comp.compilers page.
Search the
comp.compilers archives again.