Compiling K&R `\x' without -traditional

Alexandre Oliva oliva@lsd.ic.unicamp.br
Tue Feb 15 17:51:00 GMT 2000


I've stumbled across a piece of obfuscated K&R C code that backslashed
several letters that didn't form valid escape sequences within
character constants.  In particular, it relied on the fact that '\xFF'
did not exist in K&R C, and assumed '\x' would just expand to 'x'.

I understand that -traditional would allow this code to compile,
except that a lot of code in GNU libc is not compilable with
-traditional, so I thought I'd throw a little patch to allow '\x' to
compile, with a warning, instead of a hard error.

Ok to install?



More information about the Gcc-patches mailing list