https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95763

--- Comment #2 from Erich Erstu <hyena at hyena dot net.ee> ---
(In reply to Jonathan Wakely from comment #1)
> This seems like a better fit for something like clang-tidy than being
> hardcoded into the compiler.

I can see the reasoning there, but different source/header files may have
different maximum line width limitations. For example, we may have a project
where most files are limited to 80 symbols per line but a subset of header
files is limited to 240 symbols per line (as an exception). So, this could not
be handled as a project-wide restriction but rather case-by-case. For example,
those header files may contain large multidimensional nested arrays/tables
(basically data) which requires an exception to be made.

For the above reasons, it would make sense to keep the line width limit as part
of the code file that is supposed to respect that limit. Clang-tidy would have
to get these limits from an external configuration file which bloats the
project. Since GCC already implements special comments such as "// fall
through" for switch statements, I could see this implemented similarly, as a
comment in the beginning of the code file.

Reply via email to