Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSVC warnings with \W4 about C4127: conditional expression is constant #146

Closed
Naios opened this issue Apr 4, 2015 · 2 comments
Closed

Comments

@Naios
Copy link
Contributor

Naios commented Apr 4, 2015

aab64b5

Example:

dep\cppformat\format.h(2715): warning C4127: conditional expression is constant
src\server\shared\Utilities\StringFormat.h(30) : see reference to function template instantiation 'std::string fmt::sprintf<uint32>(fmt::StringRef,const uint32 &)' being compiled
src\server\shared\Logging\Log.h(67) : see reference to function template instantiation 'std::string Trinity::StringFormat<uint32>(const char *,const uint32 &)' being compiled
src\server\shared\database\Field.h(330) : see reference to function template instantiation 'void Log::outMessage<uint32>(const std::string &,const LogLevel,const char *,const uint32 &)' being compiled

Or

6>C:\Source\TrinityCore335\dep\cppformat\format.h(872): warning C4127: conditional expression is constant (C:\Source\TrinityCore335\src\server\worldserver\Main.cpp)
6>          C:\Source\TrinityCore335\dep\cppformat\format.h(871) : while compiling class template member function 'fmt::internal::MakeValue<char>::MakeValue(unsigned long)'
6>          C:\Source\TrinityCore335\dep\cppformat\format.h(2715) : see reference to function template instantiation 'fmt::internal::MakeValue<char>::MakeValue(unsigned long)' being compiled
6>          C:\Source\TrinityCore335\dep\cppformat\format.h(2715) : see reference to class template instantiation 'fmt::internal::MakeValue<char>' being compiled
6>          C:\Source\TrinityCore335\src\server\shared\Utilities\StringFormat.h(30) : see reference to function template instantiation 'std::string fmt::sprintf<uint32>(fmt::StringRef,const uint32 &)' being compiled

The actual sprintf format call is "SQL::SizeForType(): invalid field type %u", uint32(field->type).

We didn't find out what causes this warning, but we have a lot of it in our TrinityCore/TrinityCore@589296d build when compiling with \W4: http://pastebin.com/HNhKtzBZ after upgrading from revision bf8636c.

@vitaut
Copy link
Contributor

vitaut commented Apr 5, 2015

Should be fixed in fd53bb6. Thanks for reporting!

@Naios
Copy link
Contributor Author

Naios commented Apr 5, 2015

Thanks, the warnings are solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants