[RFC] Increase libstdc++ line length to 100(?) columns

Liu Hao lh_mouse@126.com
Fri Nov 27 02:45:54 GMT 2020

在 2020/11/27 上午7:50, Jonathan Wakely via Gcc 写道:
> I've touched on the subject a few times, e.g.
> https://gcc.gnu.org/pipermail/gcc/2019-December/230993.html
> and https://gcc.gnu.org/pipermail/gcc/2019-December/231013.html
> Libstdc++ code is indented by 2 columns for the enclosing namespace,
> usually another two for being in a template, and is full of __
> prefixes for reserved names. On top of that, modern C++ declarations
> are *noisy* (template head, requires-clause, noexcept-specifier, often
> 'constexpr' or 'inline' and 'explicit', and maybe some attributes.
> All that gets hard to fit in 80 columns without compromising
> readability with line breaks in unnatural places.

I think I want to vote +1 for this. On my 1920x1080 laptop screen with an 11pt monospace font, 100
colons allows me to open two terminals side by side, while still providing 3 colons for line
numbers. On a larger desktop screen with a 10pt font it'd be 132 colomns, but more often I find
lines longer than 110 characters hard to read, so I agree with 100 (but I suggest making it a
'recommended limit' instead of a 'hard limit' anyway).

There was a small fragment of code in <https://gcc.gnu.org/pipermail/gcc/2019-December/231003.html>:

>                       if (present)
>                         ptr
>                           = gfc_build_conditional_assign_expr (block, present,
>                                                                ptr, nullarg);

Why not change this to:

>                       if (present)
>                         ptr = gfc_build_conditional_assign_expr (
>                             block, present, ptr, nullarg);

I think it looks balanced and way more comfortable, and doesn't waste much leading space.

Best regards,

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20201127/2cb24741/attachment.sig>

More information about the Gcc mailing list