Skip to content

Commit 82ab619

Browse files
authored
fix build failure with Gcc 16 (#498)
Starting with Gcc 16, unused but set variables have become error. This results in the following build failure in abyss. Consensus.cpp:379:18: error: variable ‘numIgnored’ set but not used [-Werror=unused-but-set-variable=] 379 | unsigned numIgnored = 0; This change drops occurrences of the numIgnored variable, since it is unused. Bug-Debian: https://bugs.debian.org/1132058 Signed-off-by: Étienne Mollier <emollier@debian.org>
1 parent a03412a commit 82ab619

3 files changed

Lines changed: 3 additions & 10 deletions

File tree

Consensus/Consensus.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,6 @@ static void consensus(const string& outPath, const string& pileupPath)
376376
: (pileupFile.open(pileupPath.c_str()), pileupFile);
377377
assert_good(pileupOut, pileupPath);
378378

379-
unsigned numIgnored = 0;
380379
for (ContigMap::const_iterator it = g_contigs.begin();
381380
it != g_contigs.end(); ++it) {
382381
const ContigCount& contig = it->second;
@@ -397,7 +396,6 @@ static void consensus(const string& outPath, const string& pileupPath)
397396
float percentAgreement
398397
= sumBest / (float)(sumBest + sumSecond);
399398
if (isnan(percentAgreement) || percentAgreement < .9) {
400-
numIgnored++;
401399
if (opt::csToNt) {
402400
if (opt::verbose > 0)
403401
cerr << "warning: Contig " << it->first

RResolver/BloomFilters.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ loadReads(const std::vector<std::string>& readFilepaths, int r)
141141
{
142142
ReadSize::readsSampleSize = 0;
143143
ReadSize::current.sampleCount = 0;
144-
int i = 0;
145144
for (auto& b : ReadSize::readSizes) {
146145
b.sampleCount = 0;
147-
i++;
148146
}
149147

150148
for (const auto& path : readFilepaths) {

SimpleGraph/SimpleGraph.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ static void handleEstimate(const Graph& g,
516516
= makeDistanceMap(g, origin, *solIter);
517517

518518
// Remove solutions whose distance estimates are not correct.
519-
unsigned validCount = 0, invalidCount = 0, ignoredCount = 0;
519+
unsigned validCount = 0, invalidCount = 0;
520520
for (Estimates::const_iterator iter
521521
= er.estimates[dirIdx].begin();
522522
iter != er.estimates[dirIdx].end(); ++iter) {
@@ -528,7 +528,6 @@ static void handleEstimate(const Graph& g,
528528
= distanceMap.find(v);
529529
if (dmIter == distanceMap.end()) {
530530
// This contig is a repeat.
531-
ignoredCount++;
532531
vout << "ignored\n";
533532
continue;
534533
}
@@ -541,11 +540,9 @@ static void handleEstimate(const Graph& g,
541540
bool invalid = (unsigned)abs(diff) > buffer;
542541
bool repeat = repeats.count(v.contigIndex()) > 0;
543542
bool ignored = invalid && repeat;
544-
if (ignored)
545-
ignoredCount++;
546-
else if (invalid)
543+
if (invalid)
547544
invalidCount++;
548-
else
545+
else if (!ignored)
549546
validCount++;
550547
vout << "dist: " << actualDistance
551548
<< " diff: " << diff

0 commit comments

Comments
 (0)