RTEMS | _clang-format: A moved block comment keeps the old indentation (#5785)
Sebastian Huber (@sebhub)
gitlab at rtems.org
Fri Sep 25 00:42:15 UTC 2026
Issue created by Sebastian Huber: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5785
The style file `_clang-format` sets `ReflowComments: false`.
clang-format 20 and later read that value as `Never`. The tool then
moves the first line of a block comment to the indentation of the
code. It leaves the other lines of the comment where they are.
A comment inside code which the tool indents anew ends up with a broken
layout. An example from a generated test source:
```c
if ( ctx->pre_cond_contex == PRE_SERVER ) {
/*
* This call to rtems_timer_fire_after() serves to reach branch
* coverage in an if-statement which only serves performance
* optimization.
*/
```
The value `IndentOnly` indents every line of a moved comment and still
reflows no text. With it, clang-format 22.1.8 changes 378 C sources of
the tree which the current style leaves unchanged. It indents comments
anew and removes trailing white space inside comments. The format job
of the CI runs no clang-format, so no job reports these files.
The location of the style file is under discussion in #5458. This issue
concerns only the value of one option.
This description was created with Claude Code assistance.
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/work_items/5785
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/5-75ldglxhhoout9zlw6urt4gvb-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20260925/82100f37/attachment-0001.htm>
More information about the bugs
mailing list