fix gcc 12 false-positive warnings
MODIFY
ir/attrs.cpp
ir/attrs.cpp
@@ -227,7 +227,7 @@ smt::expr FpRoundingMode::toSMT() const {
}
ostream& operator<<(std::ostream &os, FpRoundingMode rounding) {
- const char *str;
+ const char *str = nullptr;
switch (rounding.mode) {
case FpRoundingMode::Dynamic: str = "dynamic"; break;
case FpRoundingMode::RNE: str = "tonearest"; break;
@@ -241,7 +241,7 @@ ostream& operator<<(std::ostream &os, FpRoundingMode rounding) {
}
ostream& operator<<(std::ostream &os, FpExceptionMode ex) {
- const char *str;
+ const char *str = nullptr;
switch (ex.mode) {
case FpExceptionMode::Ignore: str = "ignore"; break;
case FpExceptionMode::MayTrap: str = "maytrap"; break;

MODIFY
ir/fast_math.cpp
ir/fast_math.cpp
@@ -35,7 +35,7 @@ struct Node {
#ifdef DEBUG_FMF
friend ostream& operator<<(ostream &os, const Node &n) {
- const char *op;
+ const char *op = nullptr;
switch (n.operation) {
case Add: op = "add "; break;
case Sub: op = "sub "; break;

fix gcc 12 false-positive warnings