Skip to content

VisualStudio 15.7.x compilation error in /W4 /WX #748

Closed
@christophe-calmejane

Description

@christophe-calmejane

Using just released v5.0, I've got some compilation errors using VS15.7.x compiler when /W4 and /WX flags are set: "Unreachable code"

I've a workaround that consists of disabling this warning before including fmt, but it's not very "clean". Maybe there is a way to fix this warning (or to add the pragma push/disable/pop) directly in fmt headers.

This simple code (compiled in release) cause a compilation error with /W4 /WX:
#include <fmt/format.h> int main(int, char**) { fmt::format("Test"); return 0; }

The current fix for this is (win32 only)
#pragma warning(push) #pragma warning(disable:4702) #include <fmt/format.h> #pragma warning(pop)

Haven't tested on clang/gcc yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions