Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix FreeBSD build with GCC #56

Merged
merged 2 commits into from
Mar 4, 2021

Commits on Mar 3, 2021

  1. Fix FreeBSD build with GCC

    Apparently FreeBSD's GCC defines NULL to 0 in C++11 mode and this causes
    the following error:
    ```
    In file included from capsicum-test.h:15,
                     from capsicum-test.cc:1:
    gtest-1.10.0/include/gtest/gtest.h: In instantiation of 'testing::AssertionResult testing::internal::CmpHelperNE(const char*, const char*, const T1&, const T2&) [with T1 = long int; T2 = procstat*]':
    capsicum-test.cc:75:3:   required from here
    gtest-1.10.0/include/gtest/gtest.h:1621:28: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
     1609 |   if (val1 op val2) {\
          |       ~~~~~~~~~~~~
    ......
     1621 | GTEST_IMPL_CMP_HELPER_(NE, !=);
    gtest-1.10.0/include/gtest/gtest.h:1609:12: note: in definition of macro 'GTEST_IMPL_CMP_HELPER_'
     1609 |   if (val1 op val2) {\
          |            ^~
    ```
    
    Fix this by using nullptr directly.
    arichardson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    1a3f4c7 View commit details
    Browse the repository at this point in the history
  2. Update C++98 in the README to C++11

    GTest 1.10 needs C++11 and all tests are compiled with -std=c++11.
    arichardson committed Mar 3, 2021
    Configuration menu
    Copy the full SHA
    bd15493 View commit details
    Browse the repository at this point in the history