-
-
Notifications
You must be signed in to change notification settings - Fork 505
Use --werror with Linux Clang builds
#2043
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
Conversation
| @@ -1,4 +1,4 @@ | |||
| project('capstone', 'c', meson_version: '>=0.55.0') | |||
| project('capstone', 'c', meson_version: '>=0.55.0', default_options: ['werror=false']) | |||
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.
was this due to some specific clang warning for capstone? I think we already compiled with werror with gcc and capstone-bundled builds fine there.
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.
Yes
(https://github.com/rizinorg/rizin/runs/4351274434?check_suite_focus=true#step:12:697)
Apparently that s_cpu_type variable is only used in a CS_ASSERT() call and therefore in a release build, the CS_ASSERT()s disappear and that variable is left hanging.
I would ofc prefer fixing that upstream but it can take time for such fixes to merge and any new Clang warnings that pop up in Rizin code should be caught immediately (such as the warning in #2042).
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.
Apparently that
s_cpu_typevariable is only used in aCS_ASSERT()call and therefore in a release build, theCS_ASSERT()s disappear and that variable is left hanging.
Wait the above is not correct:
if (M680X_CPU_TYPE_ENDING != ARR_SIZE(s_cpu_type)) {
CS_ASSERT(M680X_CPU_TYPE_ENDING == ARR_SIZE(s_cpu_type));
return CS_ERR_MODE;
}Now the warning looks like a false positive so perhaps I should just disable the warning for Clang.
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.
Hmm now I think that Clang is justified in issuing that warning because the contents of s_cpu_type is not used.
ret2libc
left a comment
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.
It's alright. Thanks for explaining.
ANyway, it's not our code so it is not a huge deal if there are warnings there.
|
@ret2libc @kazarmy I sent a PR long time ago in capstone and it was merged in "next": capstone-engine/capstone@c93fa3a |
|
Ok capstone-engine/capstone#1801 is the cherry-pick pr for "v4". |
|
Hello guys, I have merged capstone-engine/capstone#1801. And btw, we are planning to pre-release capstone v5 base on |
Your checklist for this pull request
Detailed description
Like the Linux gcc builds, the Linux Clang builds should also be done under
--werror.Test plan
All builds are green.
Closing issues
...