Skip to content

Commit 77c56db

Browse files
committed
Regards mpaland#123: Suppressing the spurious "uninitialized" warning in older versions of GCC.
1 parent 9624be7 commit 77c56db

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/printf/printf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,15 @@ static double apply_scaling(double num, struct scaling_factor normalization)
624624

625625
static double unapply_scaling(double normalized, struct scaling_factor normalization)
626626
{
627+
#ifdef __GNUC__
628+
// accounting for a static analysis bug in GCC 6.x and earlier
629+
#pragma GCC diagnostic push
630+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
631+
#endif
627632
return normalization.multiply ? normalized / normalization.raw_factor : normalized * normalization.raw_factor;
633+
#ifdef __GNUC__
634+
#pragma GCC diagnostic pop
635+
#endif
628636
}
629637

630638
static struct scaling_factor update_normalization(struct scaling_factor sf, double extra_multiplicative_factor)

0 commit comments

Comments
 (0)