googletest icon indicating copy to clipboard operation
googletest copied to clipboard

Fix warning which complain macro not defined

Open xiaoxiang781216 opened this issue 3 years ago • 3 comments

internal/gtest-port.h:437:29: warning: "__EXCEPTIONS" is not defined, evaluates to 0 [-Wundef] internal/gtest-port.h:2132:5: warning: "_MSC_VER" is not defined, evaluates to 0 [-Wundef]

Signed-off-by: litong12 [email protected]

xiaoxiang781216 avatar Sep 12 '22 15:09 xiaoxiang781216

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Sep 12 '22 15:09 google-cla[bot]

This doesn't build:

googletest/src/gtest.cc:113:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if GTEST_HAS_EXCEPTIONS
    ^
googletest/include/gtest/internal/gtest-port.h:430:4: note: expanded from macro 'GTEST_HAS_EXCEPTIONS'
  (defined(__EXCEPTIONS) && __has_feature(cxx_exceptions))

derekmauro avatar Sep 13 '22 18:09 derekmauro

This doesn't build:

googletest/src/gtest.cc:113:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]
#if GTEST_HAS_EXCEPTIONS
    ^
googletest/include/gtest/internal/gtest-port.h:430:4: note: expanded from macro 'GTEST_HAS_EXCEPTIONS'
  (defined(__EXCEPTIONS) && __has_feature(cxx_exceptions))

Fixed.

xiaoxiang781216 avatar Sep 15 '22 03:09 xiaoxiang781216