Skip to content

Commit

Permalink
Disable unreachable code warning on MSVC
Browse files Browse the repository at this point in the history
...when compiling tests.

We get lots of these when compiling with optimisation enabled, but they all seem to be false positives, e.g. complaining that the "else" branch of an if statement is unreachable, or the constructor member-init-list of `flux::optional`, which is really weird.

I guess a lot is happening in the front end due to all our tests being constexpr, so by the time the backend sees it there's a lot of dead code?
  • Loading branch information
tcbrindle committed Jul 26, 2023
1 parent 7f8b95c commit a753e28
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ endif()
if(MSVC)
target_compile_options(test-libflux PRIVATE /W4
/wd4459 # local variable name hides global variable
/wd4702 # unreachable code
)
endif()

Expand Down

0 comments on commit a753e28

Please sign in to comment.