Open Leandros opened 6 years ago
You might need:
// *INDENT-OFF*
DISABLE_WARNING(switch-enum, switch-enum, 4444)
// *INDENT-ON*
That works, but is very tedious, and turns 2 lines to disable a warning into 6. Macros can often contain text, which is not exactly source code, and might want to be avoided to be touched by uncrustify. My DISABLE_WARNING
was just a nice example.
You could use something like set CT_IGNORE DISABLE_WARNING
but probably with another token that supports functions.
On the other hand, always try to enforce semicolons for all of your macros as a best practice. Uncrustify as a number of editors will get confused to parse those, but if they look like a function then it won't be a problem.
May we close?
I think this is a reasonable request, I had attempted to implement something similar here: #1460 but it was still buggy
I have a macro which disables warnings, and contains the warning flags for several compilers. These flags might contain a dash, and with the option to
force
a space between dashes uncrustify adds a dash and breaks the functionality.Example:
and uncrustify would transform this into:
making it invalid.
Is there a way to disable formatting inside macros?
Version: Uncrustify-0.66.1