Re: Documentation of warning/error output.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Harvey Chapman <hchapman-gcc-help@xxxxxxxx> 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

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux