[cfe-dev] clang-tidy misc-macro-parentheses

Alfred Zien via cfe-dev cfe-dev at lists.llvm.org
Thu Dec 22 04:43:22 PST 2016


Hi!

clang-tidy misc-macro-parentheses checks macros that supplied with command-line arguments.

Lets say I have simple foo.c:
int main() {};

And I write to console:

clang-tidy foo.c -checks=misc-macro-parentheses -- -DVERSION=1.23-5

It prints out 

warning: macro replacement list should be enclosed in parentheses [misc-macro-parentheses]

Firstly, it is very hard to find out why it occurs. Secondly, I couldn't figure out how to suppress it. Anybody knows good way to do it? Apart from this. this seems to be a very good check.

I'm using compile_commands.json in my project, so I can't control compiler arguments directly.

Thanks for any help!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161222/7afd1ec2/attachment.html>


More information about the cfe-dev mailing list