Skip to content
This repository has been archived by the owner on Sep 20, 2023. It is now read-only.

Squiggles start at the wrong place when there are tab characters before them #2409

Open
glibg10b opened this issue Jul 8, 2022 · 1 comment

Comments

@glibg10b
Copy link

glibg10b commented Jul 8, 2022

Notice that the squiggles start 7 characters later on the line that starts with a tab character:

image

Syntastic seemingly interprets GCC's display columns value as byte columns. GCC has -fdiagnostics-column-unit=UNIT:

       -fdiagnostics-column-unit=UNIT
           Select the units for the column number.  This affects traditional diagnostics (in the absence of -fno-show-column), as well as JSON format diagnostics if requested.

           The default UNIT, display, considers the number of display columns occupied by each character.  This may be larger than the number of bytes required to encode the character, in the case of tab characters, or it may be smaller, in the case
           of multibyte characters.

           Setting UNIT to byte changes the column number to the raw byte count in all cases, as was traditionally output by GCC prior to version 11.1.0.

This applies to gcc and avrgcc. I didn't test the other cpp checkers.

@lcd047
Copy link
Collaborator

lcd047 commented Jul 9, 2022

Please note that syntastic is dead, deprecation note is in the README.

Please also note that even when syntastic was alive, nobody really cared about the C/C++ checkers. Syntastic is a general framework for putting error messages in a box; for C/C++ there are far more capable specialized plugins such as YCM.

Still, if you insist to fix this, patches are welcome. Please make sure the fix is only applied to the gcc versions that support display units, and that it doesn't break checking with CLang.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants