This is the mail archive of the gcc-patches@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]

Re: cpplib: Implement _Pragma operator


Zack Weinberg wrote:-

> Preprocessed buffers, definitely.  It's not a huge issue, since /* or //
> surviving into phase 6 will always be a syntax error, and you have to
> play evil macro games to get them there.  But we ought to get it
> right.

Actually, thinking about it again, maybe there's nothing to do.

If we use -C, well the comments go through untouched, and we should
probably clear them if we re-preprocess such a file again (which we
do at present).

Otherwise, even playing evil macro games, the _cpp_avoid_paste routine
I implemented recently with the big macro rewrite separates a '/' and
('/' or '*') with a space, so even evil macro games can't achieve
pseudo-comments like this.  For example:-

bash-2.04$ cat ~/wacky.c 
#define STAR *
#define DIVIDE /
DIVIDE/ DIVIDE* /DIVIDE /STAR
bash-2.04$ ./cpp0 ~/wacky.c 
# 1 "/home/neil/wacky.c"


/ / / * / / / *
bash-2.04$ 

Would you agree there's nothing to do?

Neil.

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