-
Notifications
You must be signed in to change notification settings - Fork 758
odb: fix BumpMapEntry declaration mismatch #9167
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
odb: fix BumpMapEntry declaration mismatch #9167
Conversation
src/odb/include/odb/3dblox.h forward declared BumpMapEntry as a class while its definition is a struct. Clang warned about it. Signed-off-by: Ahmed R. Mohamed <[email protected]>
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.
Code Review
This pull request correctly fixes a forward declaration mismatch for BumpMapEntry in src/odb/include/odb/3dblox.h. The change modifies the forward declaration from class to struct to match its definition, which resolves a Clang compiler warning. The change is correct and improves code clarity. I approve these changes.
|
clang-tidy review says "All clean, LGTM! 👍" |
|
Hard to fix things if you don't use a compiler that issues these warnings. This compiles using clang without -Wmismatched-tags src/odb/include/odb/3dblox.h |
|
Sorry I missed it 😅 I'll create another PR. What is the standard way of compiling with clang then? I used bazel; it doesn't have all the needed flags set? |
|
You can manually run cmake with |
|
I tried |
|
bazel doesn't show this error. It may also be specific to the mac version of clang. |
|
usually clang on mac is older I think. |
|
GCC supports the warning flag. I can find them with |
|
Please add that flag to add_compile_options in src/CMakeLists.txt and OPENROAD_COPTS in BUILD.bazel (if supported in that compiler too). |
|
I'm encountering internal compiler errors with this flag on GCC. It looks like a known issue and it has complex interactions with libraries, PreCompiled Headers, and other flags. I think I found all the mismatches anyway. |
|
The only concern, I think, is "MSVC (Microsoft Visual C++) can exhibit issues with Name Mangling if tags do not match between declaration and definition". |
|
I can add it conditionally to clang and MSVC though 🤔 |
|
We don't support MSVC so I wouldn't worry about it. I suspect there would be lots of other issues. |
src/odb/include/odb/3dblox.h forward declared BumpMapEntry as a class while its definition is a struct. Clang warned about it.
Fixes: #9093