-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Fix #10431 FP one-definition-rule if struct in mutually exclusive #ifdef branches #7584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
test/cli/whole-program/odr3.cpp
Outdated
@@ -0,0 +1,6 @@ | |||
// #10431 | |||
#ifdef X | |||
struct S { int i; }; // cppcheck-suppress unusedStructMember |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you add this file odr3.cpp
to whole-program_test.py in some places?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this could become tricky.. but what happens if you have two files..
file1.cpp:
#ifdef X
struct S { int i; };
#endif
file2.cpp:
struct S { int i; };
These configurations are different but not mutually exclusive.
would it make sense to make sure that if file0 is different then all configurations are considered. If the user don't want to consider all configurations in this case then we can recommend that -D
that matches compilation is used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't you add this file
odr3.cpp
to whole-program_test.py in some places?
Absolutely, I must have thought that all files would be checked automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These configurations are different but not mutually exclusive.
I have restored the warning in that case.
Needs XML handling for |
@firewave How do I opt out of the |
Guess I found it. |
Yup. Just provide an existing Can you please file a ticket about making this work with the builddir? Thanks. |
I don't think there is anything new here, see the existing tests: |
No description provided.