liyh1984 / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

GOOGLE_GLOG_COMPILE_ASSERT causes warnings on newer gcc #198

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When compiling using the latest gcc, the compiler assertion used by LOG_EVERY_N 
generates an unused typedef warning:

              warning: typedef ‘INVALID_REQUESTED_LOG_SEVERITY’ locally defined 
              but not used [-Wunused-local-typedefs]

The Chromium base/macros.h implementation of the same code uses 
__attribute__((unused)) on the typedef to fix the problem (see 
https://chromium.googlesource.com/chromium/src/base/+/master/macros.h)

Attaching a patch which fixes the issue for me.

Original issue reported on code.google.com by tlip...@gmail.com on 7 Apr 2014 at 7:14

Attachments:

GoogleCodeExporter commented 8 years ago
I hit this bug too. It seems like it would be more likely for the patch to get 
merged if it was submitted as a github pull request. Would anybody (in 
particular the original author whose full name/email I can't see because the 
captcha page for viewing that is broken) mind if I submitted one?

Original comment by bsilver1...@gmail.com on 9 Jun 2015 at 2:20

GoogleCodeExporter commented 8 years ago
Sure, I'll send a PR

Original comment by tlip...@gmail.com on 9 Jun 2015 at 3:18