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

Build error "error: zero as null pointer constant” (Xcode 15) #833

Open
snej opened this issue Dec 1, 2023 · 0 comments
Open

Build error "error: zero as null pointer constant” (Xcode 15) #833

snej opened this issue Dec 1, 2023 · 0 comments

Comments

@snej
Copy link

snej commented Dec 1, 2023

Description

Building doctest with CMake on a Mac with Xcode 15.0 produces this error:

doctest/parts/doctest.cpp:1468:60: error: zero as null pointer constant [-Werror,-Wzero-as-null-pointer-constant]
        if(sysctl(mib, DOCTEST_COUNTOF(mib), &info, &size, 0, 0) != 0) {
                                                           ^

This does not occur when using the latest release of doctest.h in my Xcode project, oddly enough. Perhaps my config doesn’t turn on that specific warning?

Steps to reproduce

  1. Clone doctest repo
  2. cd doctest
  3. mkdir build && cd build && cmake .. && make

Extra information

  • doctest version: dev branch, d7a5eeb
  • Operating System: macOS 14.1.1
  • Compiler+version: Apple clang version 15.0.0 (clang-1500.0.40.1) i.e. Xcode 15.0
snej added a commit to snej/doctest that referenced this issue Dec 1, 2023
@snej snej mentioned this issue Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant