Fix build with -Og -Werror=maybe-uninitialized on GCC 7.2.0
It's getting tempting to just suppress -Wmaybe-uninitialized globally...
This commit is contained in:
parent
d063aa077a
commit
d480df850a
1 changed files with 14 additions and 0 deletions
|
@ -124,6 +124,16 @@ struct bad_lexical_cast : std::exception
|
|||
|
||||
namespace implementation {
|
||||
|
||||
/* Suppress -Wmaybe-uninitialized warnings.
|
||||
* I (Jyrki) noticed that building with -Og on my system (GCC 7.2.0, Boost 1.61)
|
||||
* GCC may omit a warning that the value of `fallback` may be used uninitialized.
|
||||
* It's impossible, but GCC can't prove that to itself.
|
||||
*/
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Base class for the conversion.
|
||||
*
|
||||
|
@ -485,6 +495,10 @@ struct lexical_caster<
|
|||
}
|
||||
};
|
||||
|
||||
#if defined(__GNUC__) && !defined(__clang__)
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
|
||||
} // namespace implementation
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue