Reduce some false-positive warnings from GCC to warnings with -Werror

This also works around some of the same warnings. These are known bugs
in GCC 11+ and GCC 13.x.
This commit is contained in:
Tim Wojtulewicz 2025-06-05 15:36:38 -07:00
parent cd356ce45d
commit 57a3c733d1
6 changed files with 30 additions and 22 deletions

View file

@ -40,8 +40,10 @@ std::string ZAMLocInfo::Describe(bool include_lines) const {
if ( include_lines ) {
desc += ";" + func_name + ":" + std::to_string(loc->FirstLine());
if ( loc->LastLine() > loc->FirstLine() )
desc += "-" + std::to_string(loc->LastLine());
if ( loc->LastLine() > loc->FirstLine() ) {
desc.append("-");
desc.append(std::to_string(loc->LastLine()));
}
}
}