Skip to content

Commit 38d0772

Browse files
committed
Silence g++-7.4 warning (Ubuntu 18)
Which is a wrong warning, which came with LTO and -O3. Newer g++ can detect that it is initialized in this branch
1 parent 64130f2 commit 38d0772

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/util/format_number_range.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ static void append_numbers_and_reset(
9999
"lower bound must not be larger than upper bound '" +
100100
std::to_string(*begin_range) + "-" + std::to_string(*number) + "'");
101101
}
102+
// old g++ with -O3 falsely complain for *begin_range (g++-7.4)
103+
#if __GNUC__ > 4
104+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
105+
#endif
102106
for(unsigned i = *begin_range; i < *number; ++i)
103107
numbers.push_back(i);
104108
// add upper bound separately to avoid

0 commit comments

Comments
 (0)