You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mccode-clangformat breaks long one-line #define macros #3123
devel/bin/mccode-clangformat breaks long one-line preprocessor macros. Example from IncoherentPhonon_process.comp:
#defineUNION_CASE_PHYSICS_SCATTERING_INCOHERENTPHONON(out, ...) case IncoherentPhonon: out = IncoherentPhonon_physics_scattering(__VA_ARGS__); break;
is rewritten so the macro line ends after the function call, with //break; on the next line. break is then outside the macro, and the generated switch case can fall through.
Seen in IncoherentPhonon_process.comp and Inhomogenous_incoherent_process.comp; formatting was reverted on those lines in #3095. The same dispatch-macro pattern exists in all Union *_process.comp files, so any line over the 160-column limit is affected.
Likely cause: the script escapes # lines as //__ESC__PRE#... comments before calling clang-format, and clang-format reflows comments longer than ColumnLimit, splitting the directive.
Expected: preprocessor lines (including \ continuations) pass through the formatter unchanged.
Activity
mccode-clangformat: keep preprocessor lines intact