-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
LOG_EVERY_N warns with clang -Wunused-local-typedef #223
Comments
jray272
added a commit
to jray272/glog
that referenced
this issue
Aug 6, 2017
Glog uses a pre-C++11 compile time assert to verify the validity of the severity parameter for LOG_EVERY_N. Unfortunately, some compilers will complain about the usage of LOG_EVERY_N with "-Wunused-local-typedef" due to the way the compile time assert is constructed. This makes it impossible to use LOG_EVERY_N with this warning treated as an error. The fix simply removes the assert entirely. This is safe to do since you can't put anything invalid into the severity parameters without generating a compile error elsewhere. This has been safe to do ever since the GLOG_ prefixes were added as part of 6febec3. Fixes google#223
durswd
pushed a commit
to durswd/glog
that referenced
this issue
Sep 2, 2019
Glog uses a pre-C++11 compile time assert to verify the validity of the severity parameter for LOG_EVERY_N. Unfortunately, some compilers will complain about the usage of LOG_EVERY_N with "-Wunused-local-typedef" due to the way the compile time assert is constructed. This makes it impossible to use LOG_EVERY_N with this warning treated as an error. The fix simply removes the assert entirely. This is safe to do since you can't put anything invalid into the severity parameters without generating a compile error elsewhere. This has been safe to do ever since the GLOG_ prefixes were added as part of 6febec3. Fixes google#223
munezbn
added a commit
to nagra-opentv/react-native-skia
that referenced
this issue
May 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Any usage of LOG_EVERY_N fails to compile due to the compile assert used to check the severity parameter. This generates errors that look something like:
warning: unused typedef 'INVALID_REQUESTED_LOG_SEVERITY' [-Wunused-local-typedef].
This makes it impossible to use LOG_EVERY_N with this warning treated as an error.
You can see this occurring in the following links (although in those links it's just a warning):
https://stackoverflow.com/questions/37963886/errors-when-installing-caffe-on-mac-os-x-10-10-5
BVLC/caffe#3608
I have a fix for this issue.
The text was updated successfully, but these errors were encountered: