xixip / google-glog

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

Build with strict warnings #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Include glog headers with -Wextra, -Wshadow, -Woverloaded-virtual, 
-Wreorder, and -Werror enabled.
2. Watch your project's build fail.
3. Be sad.

What is the expected output? What do you see instead?
The glog headers should be warnings-clean for internal benefit and also for 
projects that depend on glog and build with strict warnings.

What version of the product are you using? On what operating system?
glog r97, Ubuntu 11.04, g++ 4.5.2, Autoconf 2.67

Please provide any additional information below.
See attached patch.

Original issue reported on code.google.com by gba...@dbresearch.net on 8 Sep 2011 at 4:44

Attachments:

GoogleCodeExporter commented 9 years ago
It seems reasonable to make glog headers warnings-clean, but I wonder why your 
patch includes changes to .cc files too?  How do you add the warnings flags to 
your project?

If you just set AM_CXXFLAGS in your own Makefile.am, then I can only find two 
header files that need minor modifications: logging.h (two -Werror=shadow) and 
raw_logging.h (one -Werror=unused-parameter).

If instead you do something like ./configure CXXFLAGS='-W...', then I think you 
are asking for too much.  That is not just asking to make the public headers 
warnings-clean, but to make the entire glog source code warnings-clean (in a 
very strict sense).  I don't think that is reasonable, especially since glog's 
Makefile.am already makes its own explicit choice about what warnings should be 
enabled.

I'll prepare change to fix the -Werror=shadow and -Werror=unused-parameter 
issues.  I am hoping that will satisfy your needs, but please let me know if I 
am misunderstanding something.

Original comment by hlsyou...@gmail.com on 29 Dec 2011 at 3:58

GoogleCodeExporter commented 9 years ago

Original comment by hlsyou...@gmail.com on 29 Dec 2011 at 11:58

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r100.

Original comment by hlsyou...@gmail.com on 29 Dec 2011 at 12:40