Disable warnings about type conversions that may lose precision.
It's not clear that these are actually all that helpful. This also works around issue #89, wherein code like "int8 = 0" would give a warning about conversion from int32 to int8.
This commit is contained in:
6
expr.cpp
6
expr.cpp
@@ -83,6 +83,7 @@ Expr::GetBaseSymbol() const {
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
/** If a conversion from 'fromAtomicType' to 'toAtomicType' may cause lost
|
||||
precision, issue a warning. Don't warn for conversions to bool and
|
||||
conversions between signed and unsigned integers of the same size.
|
||||
@@ -122,7 +123,7 @@ lMaybeIssuePrecisionWarning(const AtomicType *toAtomicType,
|
||||
FATAL("logic error in lMaybeIssuePrecisionWarning()");
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Expr *
|
||||
Expr::TypeConv(const Type *toType, const char *errorMsgBase, bool failureOk,
|
||||
@@ -314,9 +315,12 @@ Expr::TypeConv(const Type *toType, const char *errorMsgBase, bool failureOk,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
// Disable: it's not clear this is actually all that useful
|
||||
if (!failureOk && issuePrecisionWarnings)
|
||||
lMaybeIssuePrecisionWarning(toAtomicType, fromAtomicType, pos,
|
||||
errorMsgBase);
|
||||
#endif
|
||||
|
||||
return new TypeCastExpr(toType, this, pos);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user