Preprocessor question (is gcc standard)?

Garry Garrett garry at ceco.ceco.com
Fri Mar 1 13:01:37 AEST 1991


In article <1991Feb27.155100.21972 at athena.mit.edu>, jik at athena.mit.edu (Jonathan I. Kamens) writes:
> In article <7654 at jhunix.HCF.JHU.EDU>, barrett at jhunix.HCF.JHU.EDU (Dan Barrett) writes:
* |> 	GCC's preprocessor doesn't like this code:
* |> 
* |> 		#include <ctype.h>
* |> 		#define ARGS		(x)
* |> 
* |> 		main()
* |> 		{
* |> 			...	isalpha ARGS ...
* |> 		}
* 
*   K&Rv2 says that an invocation of a macro with arguments must be the name of
* the macro, followed by optional white space, followed by '('.  It doesn't say
* that the '(' is allowed to be part of another macro that has been expanded.
* 

	Perhaps the problem is one wher GCC does not follow the standard.
Check to see that 
                 #define ARGS            (x)

is not interpreted as a macro of the form

		#define ARGS(x) ...

I know that it, shouldn't, but perhaps GCC is non-standard.



More information about the Comp.lang.c mailing list