type function(...)
REQUIRES(...)
ASSIGNS(...)
ENSURES(...)
;
Loop annotations are provided as follows:
for (...)
ASSIGNS(...)
LOOP_INVARIANT(...)
{
...
}
I looked through the existing clang-format attribute options, but could not find one that would not muddle with those annotations in these unusual places.
Ask: Provide a configuration option to clang-format similar to AttributeMacros which allows to designate macros as expected in the odd position as above, and cause them to not be touched by clang-format.
So far, we have to work around the issue by placing // clang-format on/off annotations everywhere, which is visually rather annoying.
Context: The C bounded model checker (CBMC) uses annotations of the following form to specify function contracts:
Loop annotations are provided as follows:
I looked through the existing
clang-format
attribute options, but could not find one that would not muddle with those annotations in these unusual places.Ask: Provide a configuration option to
clang-format
similar toAttributeMacros
which allows to designate macros as expected in the odd position as above, and cause them to not be touched byclang-format
.So far, we have to work around the issue by placing
// clang-format on/off
annotations everywhere, which is visually rather annoying.