Help wanted: cpp --traditional vs. X Windows

Nathanael Nerode neroden@twcny.rr.com
Tue Nov 4 06:34:00 GMT 2003


There are currently two problems with cpp --traditional (version 3.3, but
I don't see any likely changes in 3.4, although for stupid reasons I've
been unable to test it yet).

Problem 1.

Certain XWindows files use the following demented notation:
/**/#if WIDTH >= 1024
...
/**/#else
...
/**/#endif
in the expectation that those lines will *not* be treated as preprocessor
directives by cpp --traditional.

cpp-3.3, however, treats them as directives.
I'm guessing Xwindows is right here.  I can't quite grok the cpptrad.c code,
so I'm hoping that someone else can find the correct place to tell cpp
that a # after a comment does *not* begin a preprocessor directive.

----------
Problem 2.

Some Xwindows files do this:
#define BS \ /* comment */
..... BS
.....
expecting the output:
..... \
.....

This no longer works; apparently the \ is eaten while reading the macro
definition.  I'm not sure whether Xwindows is legit in doing this or not.

-- 
Nathanael Nerode  <neroden at gcc.gnu.org>
http://home.twcny.rr.com/nerode/neroden/fdl.html



More information about the Gcc mailing list