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

Valhalla does not build on macOS with clang 14.0.0 #3846

Closed
dillona opened this issue Nov 24, 2022 · 0 comments · Fixed by #3847
Closed

Valhalla does not build on macOS with clang 14.0.0 #3846

dillona opened this issue Nov 24, 2022 · 0 comments · Fixed by #3847

Comments

@dillona
Copy link
Contributor

dillona commented Nov 24, 2022

On commit d4c8c1a:

➜  build git:(master) clang --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: x86_64-apple-darwin22.1.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
➜  build git:(master) make
[  0%] Building CXX object src/midgard/CMakeFiles/valhalla-midgard.dir/logging.cc.o
/Users/dillona/dev/valhalla/src/midgard/logging.cc:42:3: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
  sprintf(&buffer.front(), "%04d/%02d/%02d %02d:%02d:%09.6f", gmt.tm_year + 1900, gmt.tm_mon + 1,
  ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
__deprecated_msg("This function is provided for compatibility reasons only.  Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.0.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
        #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                      ^
1 error generated.
make[2]: *** [src/midgard/CMakeFiles/valhalla-midgard.dir/logging.cc.o] Error 1
make[1]: *** [src/midgard/CMakeFiles/valhalla-midgard.dir/all] Error 2
make: *** [all] Error 2
dillona added a commit to dillona/valhalla that referenced this issue Nov 24, 2022
dillona added a commit to dillona/valhalla that referenced this issue Nov 24, 2022
kevinkreiser added a commit that referenced this issue Nov 25, 2022
* Use snprintf instead of sprintf

Fixes #3846

* Update src/midgard/logging.cc

Co-authored-by: Kevin Kreiser <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant