fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
19.83k stars 2.42k forks source link

MSVC warning C4702 for compile.h #4044

Closed oold closed 6 hours ago

oold commented 3 days ago

MSVC (VS 16.11.37, toolset v142) emits warning C4702 (unreachable code) at warning level 4 for this line: https://github.com/fmtlib/fmt/blame/e69e5f977d458f2650bb346dadf2ad30c5320281/include/fmt/compile.h#L151

I wasn't able to test this on Godbolt since MSVC wouldn't find the fmt headers on there. Code looks about the same in trunk, so I'd assume the warning would be emitted, too.

vitaut commented 6 hours ago

Fixing all possible warnings (especially level 4 which have tons of false positive) is a non-goal but you can suppress them with FMT_SYSTEM or other means.