address clang 10 warnings

This commit is contained in:
Vern Paxson 2021-11-24 11:56:01 -08:00
parent e0b4659488
commit a830c269ab
2 changed files with 9 additions and 1 deletions

View file

@ -1099,7 +1099,7 @@ eval auto v = frame[z.v2].double_val;
ZAM_run_time_error(z.loc, "underflow converting double to count");
break;
}
if ( v > UINT64_MAX )
if ( v > static_cast<double>(UINT64_MAX) )
{
ZAM_run_time_error(z.loc, "overflow converting double to count");
break;

View file

@ -379,6 +379,13 @@ const ZAMStmt ZAMCompiler::GenCond(const Expr* e, int& branch_v)
else
branch_v = 2;
// clang 10 gets perturbed that the indentation of the "default" in the
// following switch block doesn't match that of the cases that we include
// from "ZAM-Conds.h". It really shouldn't worry about indentation mismatches
// across included files since those are not indicative of possible
// logic errors, but Oh Well.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmisleading-indentation"
switch ( e->Tag() )
{
#include "ZAM-Conds.h"
@ -386,6 +393,7 @@ const ZAMStmt ZAMCompiler::GenCond(const Expr* e, int& branch_v)
default:
reporter->InternalError("bad expression type in ZAMCompiler::GenCond");
}
#pragma GCC diagnostic pop
// Not reached.
}