Skip to content

Commit

Permalink
Disable some spurious MSVC warnings
Browse files Browse the repository at this point in the history
Not that it will de-clutter our CI logs very much, but eh, you know.
  • Loading branch information
ISSOtm committed Mar 28, 2024
1 parent e5078ab commit 0c0923a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ option(SANITIZERS "Build with sanitizers enabled" OFF) # Ignored on MSVC
option(MORE_WARNINGS "Turn on more warnings" OFF) # Ignored on MSVC

if(MSVC)
# MSVC's standard library triggers warning C5105,
# "macro expansion producing 'defined' has undefined behavior"
# MSVC's own standard library triggers warning C5105,
# "macro expansion producing 'defined' has undefined behavior".
# Warning C5030 is about unknown attributes (`[[gnu::ATTR]]`), none of ours being load-bearing.

This comment has been minimized.

Copy link
@Rangi42

Rangi42 Mar 28, 2024

Contributor

I'd rather have hidden platform-specific attributes behind a macro.

This comment has been minimized.

Copy link
@ISSOtm

ISSOtm Mar 28, 2024

Author Member

Note that the standard defines that unknown namespaced attributes shall be ignored without an error; that's why I switched to using that syntax.

# Warning C4996 is about using POSIX names, which we want to do for portability.
# We also opt into the C++20-conformant preprocessor.
add_compile_options(/MP /wd5105 /Zc:preprocessor)
add_compile_options(/MP /wd5105 /wd5030 /wd4996 /Zc:preprocessor)
add_definitions(/D_CRT_SECURE_NO_WARNINGS)

if(SANITIZERS)
Expand Down

0 comments on commit 0c0923a

Please sign in to comment.