You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D:\src\example>cmake -S. -Bbuild -G"Visual Studio 17 2022"
-- The C compiler identification is MSVC 19.41.34123.0
-- The CXX compiler identification is MSVC 19.41.34123.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.41.34120/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- {fmt} version: 11.0.2
-- Build type:
-- Configuring done (3.6s)
-- Generating done (0.1s)
-- Build files have been written to: D:/src/example/build
D:\src\example>cmake --build build
MSBuild version 17.11.9+a69bbaaf5 for .NET Framework
1>Checking Build System
Building Custom Rule D:/src/example/fmt/CMakeLists.txt
format.cc
os.cc
Generating Code...
fmt.vcxproj -> D:\src\example\build\fmt\Debug\fmtd.lib
Building Custom Rule D:/src/example/CMakeLists.txt
main.cpp
D:\src\example\fmt\include\fmt\format.h(1793,25): error C2220: the following warning is treated as an error [D:\src\example\build\example.vcxproj]
(compiling source file '../main.cpp')
D:\src\example\fmt\include\fmt\format.h(1793,25): warning C4127: conditional expression is constant [D:\src\example\build\example.vcxproj]
(compiling source file '../main.cpp')
D:\src\example\fmt\include\fmt\format.h(1816,7): warning C4127: conditional expression is constant [D:\src\example\build\example.vcxproj]
(compiling source file '../main.cpp')
D:\src\example\fmt\include\fmt\base.h(2888,7): warning C4127: conditional expression is constant [D:\src\example\build\example.vcxproj]
(compiling source file '../main.cpp')
D:\src\example\fmt\include\fmt\base.h(2888,7):
the template instantiation context (the oldest one first) is
D:\src\example\main.cpp(4,10):
see reference to function template instantiation 'void fmt::v11::print<>(fmt::v11::fstring<>)' being compiled
If this was coming while compiling format.cc then I wouldn't mind doing a target_compile_options(fmt ...) to disable the warning on fmt, but since this is happening in a header I get it in my own target too. I'd rather not have to disable this warning on my whole project or wrap every #include <fmt/format.h> with pragmas to disable it.
The text was updated successfully, but these errors were encountered:
vitaut
changed the title
MSVC build failure - C4127: conditional expression is constant
MSVC warning - C4127: conditional expression is constant
Oct 29, 2024
Seeing this on latest master.
minimal repro:
CMakeLists.txt
main.cpp
If this was coming while compiling format.cc then I wouldn't mind doing a
target_compile_options(fmt ...)
to disable the warning on fmt, but since this is happening in a header I get it in my own target too. I'd rather not have to disable this warning on my whole project or wrap every#include <fmt/format.h>
with pragmas to disable it.The text was updated successfully, but these errors were encountered: