zmoon111 / google-breakpad

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

Compiling with -Wall and GCC 4.8.1 throws warnings in scoped_ptr.h #534

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write code that includes client/linux/handler/exception_handler.h
2. Compile with GCC 4.8.1 and -Wall

What is the expected output? What do you see instead?
I expect no warnings, but I get this (actually this is with -Wall -Werror but 
either way):

.../breakpad/include/common/scoped_ptr.h: In destructor 
'google_breakpad::scoped_ptr<T>::~scoped_ptr()':
.../breakpad/include/common/scoped_ptr.h:74:18: error: typedef 
'type_must_be_complete' locally defined but not used 
[-Werror=unused-local-typedefs]
     typedef char type_must_be_complete[sizeof(T)];

Etc. for the other instances.

What version of the product are you using? On what operating system?
Version 1188
GNU/Linux Ubuntu 12.04 (with a locally-built GCC 4.8.1)

Please provide any additional information below.
I attached a patch, which just comments out the unused typedefs.
Note there are similar typedefs in the protobuf code, but unlike my own code 
when I compile breakpad I don't use -Werror so it is not fatal.

Original issue reported on code.google.com by pds.mads...@gmail.com on 1 Jun 2013 at 2:33

Attachments:

GoogleCodeExporter commented 9 years ago
I think we actually want these, since they're actually static assertions in 
disguise. We could probably do some #ifdefs and use static_assert when it's 
available.

Original comment by ted.mielczarek on 1 Jun 2013 at 6:48

GoogleCodeExporter commented 9 years ago
I understand the intent behind the code, but IMHO it's not worth having if the 
compiler generates warnings about it (certainly not in, or referred to by, 
header files which are exposed to the user as part of the library 
API--internally building libbreakpad.a etc. is another matter).

Thanks!

Original comment by pds.mads...@gmail.com on 1 Jun 2013 at 8:34

GoogleCodeExporter commented 9 years ago
The scoped_ptr.h file in Breakpad is very old. I'd just swap it out for a 
better one: https://breakpad.appspot.com/964002/

Original comment by thestig@chromium.org on 18 Dec 2013 at 2:06

GoogleCodeExporter commented 9 years ago
r1265

Original comment by thestig@chromium.org on 18 Dec 2013 at 7:50