OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogutil commits / 5fb9130

Add -Wno-volatile to gcc flags, to avoid guile spew
5fb91306dd9c2c23fae1b7bd1bb9a175f9a967d2
by Linas Vepštas <linasvepstas@gmail.com> · 2025-12-07T02:25:34.000Z

Changed files (1) +12 -6

cmake/OpenCogGccOptions.cmake +12 -6
……@@ -47,14 +47,20 @@ IF (CMAKE_COMPILER_IS_GNUCXX)
4747 SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} <LINK_LIBRARIES>")
4848 ENDIF (APPLE)
4949
50 # 1) -Wno-variadic-macros is to avoid warnings regarding using
51 # variadic in macro OC_ASSERT (the warning warns that this is only
52 # available from C99, lol!)
50 # *) -Wno-variadic-macros is to avoid warnings regarding using
51 # variadic in macro OC_ASSERT (the warning warns that this is
52 # only available from C99, lol!)
5353 #
54 # 2) -fopenmp for multithreading support
54 # *) -Wno-volatile because guile-3.0 has `(volatile SCM *)` sprinkled
55 # throughout the code base, and g++20 spews warning about this.
5556 #
56 # 3) -std=gnu++20 for C++20 and GNU extensions support
57 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-variadic-macros -fopenmp -std=gnu++20")
57 # *) -fopenmp for omp multithreading. It's not used much but does
58 # get a sprinkling in the codebase.
59 #
60 # *) -std=gnu++20 for C++20 Mostly for std::atomic::wait, but also
61 # a few other randos.
62 #
63 SET(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -Wno-volatile -Wno-variadic-macros -fopenmp -std=gnu++20")
5864
5965 SET(CMAKE_CXX_FLAGS_ASAN ${CMAKE_C_FLAGS_ASAN})
6066 SET(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG})