Fixes 2 Bugs and 13 Compiler Warnings (#10670)

* fixes: %g directive writing between 1 and 13 bytes into a region of size between 6 and 18 [-Wformat-overflow=]

* fixes: %5s directive writing between 5 and 63 bytes into a region of size 58 [-Wformat-overflow=]

* fixes: catching polymorphic type by value [-Wcatch-value=]

* fixes: [-Wcomment]; removes whitespaces

* increases buffer size from 71B to 90B to avoid potential ovfl.
This commit is contained in:
Dipl.-Ing. Raoul Rubien, BSc
2026-08-05 21:41:04 +08:00
committed by GitHub
parent a10d9e77cf
commit 23bd320076
12 changed files with 30 additions and 31 deletions
+1 -1
View File
@@ -883,7 +883,7 @@ std::string AppConfig::load()
}
}
}
} catch(std::exception err) {
} catch(const std::exception &err) {
BOOST_LOG_TRIVIAL(info) << format("parse app config \"%1%\", error: %2%", AppConfig::loading_path(), err.what());
return err.what();
+1 -1
View File
@@ -3576,7 +3576,7 @@ Polylines FillLateralHoneycomb::fill_surface(const Surface *surface, const FillP
// |
// |
// 0 --+--
// / \
// ⟋ ⟍
// why inverted?
// it makes determining some of the properties easier
// and the two angled legs provide additional horizontal stiffness
+1 -1
View File
@@ -712,7 +712,7 @@ unsigned int Step::get_triangle_num(double linear_deflection, double angle_defle
return 0;
}
}
} catch(Exception e) {
} catch(const Exception &e) {
return 0;
}
+1 -1
View File
@@ -5511,7 +5511,7 @@ LayerResult GCode::process_layer(
// add tag for processor
gcode += ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change) + "\n";
// export layer z
char buf[64];
char buf[80];
sprintf(buf, print.is_BBL_printer() ? "; Z_HEIGHT: %g\n" : ";Z:%g\n", print_z);
gcode += buf;
// export layer height