[Bug preprocessor/22168] New: #if #A == #B should have a diagnostic

Andrew Pinski pinskia@physics.uc.edu
Fri Jun 24 15:42:00 GMT 2005


On Jun 23, 2005, at 10:04 PM, geoffk at gcc dot gnu dot org wrote:

> GCC quietly accepts the following:
>
> #define A a
> #define B a
> #if #A == #B
> #endif

In fact if we look at the output for the following code:
#define A b
#define B c
#if #A == #B
void g(void);
#endif

We find that "void g(void);" is always outputted so in fact
it does not do what David wanted it to do.

Thanks,
Andrew Pinski



More information about the Gcc-bugs mailing list