Treat warnings as error and fix most level 4 warnings in the breakpad windows
client projects.
Some of the lint errors in the files touched by this change were also fixed.
BUG=533
Committed: https://code.google.com/p/google-breakpad/source/detail?r=1189
Not LGTM.
Warnings complaining about unused parameters and |while (true)| are not useful.
We don’t use these warnings in Chrome. They force you to litter code with
unnecessary annotations and less-readable forms.
If you want to use this warning level, please disable the useless warnings.
On 2013/05/30 12:35:55, Mark Mentovai wrote:
> Not LGTM.
>
> Warnings complaining about unused parameters and |while (true)| are not
useful.
> We don’t use these warnings in Chrome. They force you to litter code with
> unnecessary annotations and less-readable forms.
>
> If you want to use this warning level, please disable the useless warnings.
Done.
https://breakpad.appspot.com/601002/diff/13001/src/client/windows/build/common.gypi File src/client/windows/build/common.gypi (right): https://breakpad.appspot.com/601002/diff/13001/src/client/windows/build/common.gypi#newcode1 src/client/windows/build/common.gypi:1: # Copyright (c) 2010, Google Inc. In the CL ...
https://breakpad.appspot.com/601002/diff/13002/src/common/windows/http_upload.cc File src/common/windows/http_upload.cc (right): https://breakpad.appspot.com/601002/diff/13002/src/common/windows/http_upload.cc#newcode340 src/common/windows/http_upload.cc:340: unsigned int uint_length = static_cast<unsigned int>(length); What are you ...
LGTM https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload.cc File src/common/windows/http_upload.cc (right): https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload.cc#newcode343 src/common/windows/http_upload.cc:343: if (static_cast<std::streamoff>(vector_size) == length) { I thought that ...
LGTM
https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload.cc
File src/common/windows/http_upload.cc (right):
https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload...
src/common/windows/http_upload.cc:343: if
(static_cast<std::streamoff>(vector_size) == length) {
I thought that both size_type and streamoff were “long” (32-bit) on 32-bit
Windows, and “long long” or some other 64-bit type on 64-bit windows. The
difference is that size_type is unsigned and streamoff is signed. Is this
correct?
If so, wouldn’t a more straightforward way to check that your streamoff length
can fit in a size_type be to just make sure that length >= 0?
.
https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload.cc
File src/common/windows/http_upload.cc (right):
https://breakpad.appspot.com/601002/diff/25001/src/common/windows/http_upload...
src/common/windows/http_upload.cc:343: if
(static_cast<std::streamoff>(vector_size) == length) {
On 2013/06/04 13:19:41, Mark Mentovai wrote:
> I thought that both size_type and streamoff were “long” (32-bit) on
32-bit
> Windows, and “long long” or some other 64-bit type on 64-bit windows. The
> difference is that size_type is unsigned and streamoff is signed. Is this
> correct?
>
> If so, wouldn’t a more straightforward way to check that your streamoff length
> can fit in a size_type be to just make sure that length >= 0?
No, on Windows, I'm getting 64-bits for std::streamoff and 32-bits for the
size_type. The static_cast handles the negative cases as well.
Here is how streamoff is defined. It says that up to GCC 3.3 it was defined as
long, but now it appears to be int64_t:
/**
...
* Note: In versions of GCC up to and including GCC 3.3, streamoff
* was typedef long.
*/
#ifdef _GLIBCXX_HAVE_INT64_T_LONG
typedef long streamoff;
#elif defined(_GLIBCXX_HAVE_INT64_T_LONG_LONG)
typedef long long streamoff;
#elif defined(_GLIBCXX_HAVE_INT64_T)
typedef int64_t streamoff;
#else
typedef long long streamoff;
#endif
Issue 601002: Fixing level 4 warnings
(Closed)
Created 11 years, 5 months ago by Ivan Penkov
Modified 11 years, 5 months ago
Reviewers: Mark Mentovai, Ted Mielczarek, Jess, sorin_google.com, mmandlis1
Base URL: http://google-breakpad.googlecode.com/svn/trunk/
Comments: 20