r f wrote:

because i´ve trouble with kernel source files for arm i also tested the sources from mspgcc (with
find -name \*.h -type f -print0 | xargs -0 indent
find -name \*.c -type f -print0 | xargs -0 indent)
and found dozens sytax errors like these:

mspgcc/cvs_27.10.03/gdb-5.1.1/bfd/bfd-in.h:778: Error:Unexpected end of file mspgcc/cvs_27.10.03/binutils-2.14/binutils/testsuite/binutils-all/readelf.h:21: Warning:Unterminated character constant
mspgcc/cvs_27.10.03/gcc-3.2.3/gcc/limity.h:4: Error:Unmatched #else
mspgcc/cvs_27.10.03/gcc-3.2.3/gcc/limity.h:10: Error:Unmatched #endif

Why is there so much (pseudo-)code which can't be compiled?

you did not compile, you used a formating tool. maybe that one doesnt
know C perfectly ;-)

then, all the "errors" shown above are in files that are from the official gnu sources and not from our patches, maybe ask the maintainers of these files why they are using that style of C programming.

in the case of limity.h, a glance at the source file reveals:
/* This administrivia gets added to the end of limits.h
   if the system has its own version of limits.h.  */

thats why it has unmatched preprocessor commands.

maybe, some are indeed real errors, but the code is in a commented out block or not relevant for all the platforms in use.

and if you're looking for code that very well compiles but probably isn't liked by indent: http://www.ioccc.org/ (The International Obfuscated C Code Contest) has a lot of nice examples :-)

chris

Reply via email to