Compiling with -ansi and -pedantic

Hi,

I'd like to use the compiler flags -ansi -pedantic -Wno-long-long in my
project but some llvm headers cause errors with them. I tried to compile llvm
with these flags but it proved to be quite difficult. The headers, however,
seemed easier to fix. Almost all of the errors were commas at the ends of
enum lists or extraneous semicolons after namespaces.

I went ahead and hunted down these trivial errors by running each header
through gcc with -D__STDC_LIMIT_MACROS -ansi -pedantic -Wno-long-long -x c++
-S. Obviously a few headers required configuration macros and did not
therefore compile cleanly, so I might have missed potential errors in those.

Included is a patch against today's CVS that fixes what I managed to find.

llvm-pedantic-headers.patch (18.9 KB)

I'd like to use the compiler flags -ansi -pedantic -Wno-long-long in my
project but some llvm headers cause errors with them. I tried to compile llvm
with these flags but it proved to be quite difficult. The headers, however,
seemed easier to fix. Almost all of the errors were commas at the ends of
enum lists or extraneous semicolons after namespaces.

Looks good, applied:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060220/032052.html
...
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20060220/032059.html

Thanks for the patch!

I went ahead and hunted down these trivial errors by running each header
through gcc with -D__STDC_LIMIT_MACROS -ansi -pedantic -Wno-long-long -x c++
-S. Obviously a few headers required configuration macros and did not
therefore compile cleanly, so I might have missed potential errors in those.

It would be nice to just fix all of these issues throughout LLVM. If we just built LLVM with those options, you would know that all cases are covered, and that no future cases will slip in.

-Chris