Add a version check for duplicated-branches warning

The GHashTable code ignores the duplicated-branches GCC warning, but we
need to do a compiler and version check, as either non-GCC compatible
compilers, or older versions of GCC will warn about the unknown pragma
or diagnostic.

If we don't do this while turning warnings into error, we're going to
fail the build unnecessarily.
This commit is contained in:
Emmanuele Bassi 2019-04-29 16:49:36 +01:00
parent 99d068fb90
commit 6cb6b418bf

View File

@ -56,7 +56,9 @@
*
* ...and still compile successfully when -Werror=duplicated-branches is passed. */
#if defined(__GNUC__) && __GNUC__ > 6
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif
/**
* SECTION:hash_tables