This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Documentation of warning/error output.
Harvey Chapman <hchapman-gcc-help@3gfp.com> writes:
> I don't get that column for all errors:
>
> echo -e "#warning Blah\n int main() { printf(); } \n#error
> Joe\n\n\n\n" | gcc -o a.out -x c -
> <stdin>:1:2: warning: #warning Blah
> <stdin>: In function 'main':
> <stdin>:2: warning: incompatible implicit declaration of built-in
> function 'printf'
> <stdin>:2: error: too few arguments to function 'printf'
> <stdin>:3:2: error: #error Joe
In current versions of gcc, by default, the preprocessor reports a
column number and the compiler proper does not. You can use
-fno-show-column to tell the preprocessor to not report column numbers.
You can use -fshow-column to tell the compiler proper to report column
numbers, but don't bother, because they are wildly inconsistent.
There is work in progress to straighten out this difference in gcc 4.5,
and also to significantly improve the column number reporting in the
compiler proper.
Ian