On 17/04/15 16:42, Tom Tromey wrote:
"Dave" == David Malcolm <dmalc...@redhat.com> writes:
Dave> However within libcpp and gcc, in linemap's expanded_location and in
Dave> diagnostic messages, the "column" numbers are actually 1-based counts of
Dave> *characters*, so the "column" numbers emitted in diagnostics for the
Dave> start of the first token in each line are actually:
FWIW this is actually in violation of the GNU coding standards. There's
a bug open for it. However, I was always afraid to change this in cpp,
since presumably it would break existing programs that read gcc's
output. It's a bad situation because the standard can't be changed,
either, as other programs (e.g., bison and I think Emacs) do follow it
faithfully.
Which programs rely on precise column numbers given by GCC? They cannot be very
old neither unused to pain.
This "bug" actually breaks going to an error location in Emacs's compilation
mode, which is annoying when compiling GCC's code.
Dave> (i) a consistent value for tabs in terms of spaces, or
There's already -ftabstop for this, but it isn't per-file.
And it doesn't actually do anything: https://gcc.gnu.org/PR52899
Perhaps it should be fixed to do what was intended and influence how cpp
transforms tabs as columns?
Also, there is https://gcc.gnu.org/PR49973, which means that non-ascii
characters may mess up "visual" indentation.
Cheers,
Manuel.