Skip to content

Commit

Permalink
- fixed: explicit float to int casts should not emit truncation warni…
Browse files Browse the repository at this point in the history
…ngs.
  • Loading branch information
coelckers committed May 19, 2021
1 parent f0d8bd0 commit bd0ca55
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/scripting/backend/codegen.cpp
Expand Up @@ -932,7 +932,7 @@ FxExpression *FxIntCast::Resolve(FCompileContext &ctx)
{
ExpVal constval = static_cast<FxConstant *>(basex)->GetValue();
FxExpression *x = new FxConstant(constval.GetInt(), ScriptPosition);
if (constval.GetInt() != constval.GetFloat())
if (constval.GetInt() != constval.GetFloat() && !Explicit)
{
ScriptPosition.Message(MSG_WARNING, "Truncation of floating point constant %f", constval.GetFloat());
}
Expand Down

0 comments on commit bd0ca55

Please sign in to comment.