a scanf question and a preprocessor question

Henry Spencer henry at utzoo.uucp
Tue Feb 28 03:13:23 AEST 1989


In article <9772 at cit-vax.Caltech.Edu> johns at wega.caltech.edu (John Salmon) writes:
>In section 4.9.6.2, the fscanf function:
>I have a very old version of the standard which says the the 
>argument corresponding to a %x directive should be an int, and that
>the conversion is performed according to the rules for strtol.
>If this is true, then there is no way to convert hex constants between
>LONG_MAX and ULONG_MAX...

The wording on this has changed considerably, with problems like that
in mind.

>In section 3.8.1 Conditional Inclusion, paragraph 2: Semantics:
>...During this evaluation, each identifier not currently defined
>as a macro evaluates to 0...
>I am told that this is no longer the case, and that undefined symbols
>in #if pre-processor constant expressions are in error...

You're mistaking people with broken compilers for a change in the standard.
Unknown identifiers still evaluate to 0.  The problem is that K&R1 wasn't
explicit about this and so some compilers object; they will have to be
fixed.
-- 
The Earth is our mother;       |     Henry Spencer at U of Toronto Zoology
our nine months are up.        | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list