Standardization questions (cpp mostly)

Joe Mueller joemu at tekecs.UUCP
Tue Oct 9 03:51:57 AEST 1984


> The number of predefined CPP variables on systems worldwide
> is growing weekly.  The following innocent program fails to compile
> on our Gould system:
> 	grumble()
> 	{
> 		int sel;
> 
> 		sel = selectone();
> 		...
> 	}
> The reason is that 'sel' is a predefined CPP variable!
> (It is quite difficult for a novice user to figure out what is going wrong.)
> Other people will find similar strange problems if they use
> variables named 'pyramid', 'sun', and so on.  This is ridiculous!

The ANSI committee has concidered this problem. The current draft will
state that predefined macros are implementation defined (They will
exist BUT you will be provided with a list of them and what they are
defined to be), and all conforming compilers MUST have some way of
disabling all predefined macros. This way if your application does not
want to use them, you may easily remove them without a never-ending,
always changing list of #undef foobar's.



More information about the Comp.lang.c mailing list