cpp bug

Bob Kenny bob@linkmed.org
Thu May 23 04:38:00 GMT 2002


Hi,

I have just upgraded from 2.95.2 to 3.0.1 and when compiling programs I
get a warning from the pre-processor saying

extra tokens at end of xxxxxx directive

This is caused by commands such as

#endif FRED

On looking at the code in cpplib.c in the routine ckeck_eol, the warning
is generated by cpp_pedwarn wich is a pedantic warning but there is no
test for the pedantic flag being set. I have overcome this by using 

  if (CPP_PEDANTIC (pfile) && token.type != CPP_EOF)

so that the warning is only issued if the pedantic flag is used.

Is this a bug or is it now a non-pedantic warning. In Solaris some of
their own .h files generate this warning so it is a bit annoying.


Thanks for all all your good work and the new features.

-- 
Regards

Bob
_______________________________________________________________________
Bob Kenny, 
Link Medical Limited,
Unit 9,
Moor Place Farm,
Plough Lane
Bramshill,
Hampshire RG27 0RF
England

Tel : (+44) 0118 9326850
Fax : (+44) 0118 9326717

Email : bob@linkmed.org
Mobile: (+44) 7711 691880
_______________________________________________________________________



More information about the Gcc-bugs mailing list