Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(38)

Issue 483002: Fix some compiler errors in exception_handler_unittest by casting like crazy (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 1 month ago by Ted Mielczarek
Modified:
12 years, 1 month ago
Reviewers:
digit, jimb
CC:
google-breakpad-dev_googlegroups.com
Visibility:
Public.

Description

The unit test added in r1067 fails to compile for me with Ubuntu's GCC 4.6.3. I
get template errors in gtest:

In file included from
../google-breakpad/src/testing/gtest/include/gtest/gtest.h:55:0,
                 from ../google-breakpad/src/breakpad_googletest_includes.h:33,
                 from
../google-breakpad/src/client/linux/handler/exception_handler_unittest.cc:41:
../google-breakpad/src/testing/gtest/include/gtest/internal/gtest-internal.h: In
function ‘testing::internal::String
testing::internal::FormatForFailureMessage(T*) [with T = void(int)]’:
../google-breakpad/src/testing/gtest/include/gtest/gtest.h:1246:39:  
instantiated from ‘testing::internal::String
testing::internal::FormatForComparisonFailureMessage(const T1&, const T2&) [with
T1 = void (*)(int), T2 = void (*)(int)]’
../google-breakpad/src/testing/gtest/include/gtest/gtest.h:1377:1:  
instantiated from ‘testing::AssertionResult testing::internal::CmpHelperNE(const
char*, const char*, const T1&, const T2&) [with T1 = void (*)(int), T2 = void
(*)(int)]’
../google-breakpad/src/client/linux/handler/exception_handler_unittest.cc:341:5:
  instantiated from here
../google-breakpad/src/testing/gtest/include/gtest/internal/gtest-internal.h:238:62:
error: invalid static_cast from type ‘void (*)(int)’ to type ‘const void*’

Adding copious casts fixes the issue for me.

Patch Set 1 #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats Patch
M src/client/linux/handler/exception_handler_unittest.cc View 1 chunk +4 lines, -2 lines 1 comment Download

Messages

Total messages: 6
Ted Mielczarek
12 years, 1 month ago #1
jimb_red-bean.com
Yeah, those SIG_ constants have stunk from the day they were introduced... :(
12 years, 1 month ago #2
digit
lgtm (not owner) http://breakpad.appspot.com/483002/diff/1/src/client/linux/handler/exception_handler_unittest.cc File src/client/linux/handler/exception_handler_unittest.cc (right): http://breakpad.appspot.com/483002/diff/1/src/client/linux/handler/exception_handler_unittest.cc#newcode344 src/client/linux/handler/exception_handler_unittest.cc:344: reinterpret_cast<void*>(SIG_ERR)); Interesting, I don't get these ...
12 years, 1 month ago #3
Ted Mielczarek
On Mon, Oct 15, 2012 at 7:47 AM, <digit@chromium.org> wrote: > http://breakpad.appspot.com/483002/diff/1/src/client/linux/handler/exception_handler_unittest.cc#newcode344 > src/client/linux/handler/exception_handler_unittest.cc:344: > ...
12 years, 1 month ago #4
digit
It's a 64-bit Ubuntu 12.04 install, gcc -v gives: ... gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) ...
12 years, 1 month ago #5
Ted Mielczarek
12 years, 1 month ago #6
On Mon, Oct 15, 2012 at 11:31 AM,  <digit@chromium.org> wrote:
> It's a 64-bit Ubuntu 12.04 install, gcc -v gives:
>
>   ...
>   gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5)

I have the exact same version (unsurprisingly).

> I suspect this may be due to different definitions of SIG_ERR in the
> GLibc headers. Mine are:
>
> /usr/include/x86_64-linux-gnu/bits/signum.h:
>   #define SIG_ERR       ((__sighandler_t) -1)

That matches mine exactly as well. I have no idea why I was hitting
this and you weren't.

-Ted
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1004:630ec63f810e-tainted