head 1.1; access; symbols; locks; strict; comment @// @; 1.1 date 2026.08.30.01.13.18; author gdt; state Exp; branches; next ; commitid krEgFSBfxMVBbBTG; desc @@ 1.1 log @archivers/par2: Work around gcc 10 bug It seems that when an ostringstream is operated on with <<, the resulting object is an ostream, not an ostringstream, and one can't .str() that. Simplify the code and use variables. All tests pass on NetBSD 10 amd64. @ text @$NetBSD$ Apparently, gcc<=10, when using ostringstream, somehow turns the type into ostream after <<, and ostream has no str(). Not yet filed upstream, because probably upstream does not regard gcc 10 as reasonable, or they would have CI with it. --- src/par2repairer.cpp.orig 2026-08-30 01:03:00.454241587 +0000 +++ src/par2repairer.cpp @@@@ -1673,9 +1673,12 @@@@ bool Par2Repairer::ScanDataFile(DiskFile { if (lastmatchoffset < filechecksummer.Offset() && noiselevel > nlNormal) { - progress.PrintLine((std::ostringstream() - << "No data found between offset " << lastmatchoffset - << " and " << filechecksummer.Offset()).str()); + // Avoid gcc <= 10 bug. + std::ostringstream oss = std::ostringstream(); + oss << "No data found between offset " << lastmatchoffset + << " and " << filechecksummer.Offset(); + + progress.PrintLine(oss.str()); } // Is this the first match @@@@ -1805,9 +1808,12 @@@@ bool Par2Repairer::ScanDataFile(DiskFile if (lastmatchoffset < filechecksummer.Offset() && noiselevel > nlNormal) { - progress.PrintLine((std::ostringstream() - << "No data found between offset " << lastmatchoffset - << " and " << filechecksummer.Offset()).str()); + // Avoid gcc <= 10 bug. + std::ostringstream oss = std::ostringstream(); + oss << "No data found between offset " << lastmatchoffset + << " and " << filechecksummer.Offset(); + + progress.PrintLine(oss.str()); } // Get the Full and 16k hash values of the file @