This happens for both a fresh build from master and the latest release.
Note that if I add redundant parentheses to the macro like this: #define ADD_INT(x, y) add(x, &((int){y})) it works fine, but these expressions are equivalent as compound literals have higher precedence than the & operator. They build fine in both gcc and clang.
When using the experimental clang parser this error doesn't occur.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've failed to execute cppcheck on a larger codebase and condensed the problem to the following example:
Running cppcheck on this file yields this error:
This happens for both a fresh build from master and the latest release.
Note that if I add redundant parentheses to the macro like this:
#define ADD_INT(x, y) add(x, &((int){y}))
it works fine, but these expressions are equivalent as compound literals have higher precedence than the&
operator. They build fine in both gcc and clang.When using the experimental clang parser this error doesn't occur.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/13833