This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cpp bug


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
_______________________________________________________________________


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]