mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-09 02:46:16 +01:00
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:
parent
99d068fb90
commit
6cb6b418bf
@ -56,7 +56,9 @@
|
|||||||
*
|
*
|
||||||
* ...and still compile successfully when -Werror=duplicated-branches is passed. */
|
* ...and still compile successfully when -Werror=duplicated-branches is passed. */
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && __GNUC__ > 6
|
||||||
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
#pragma GCC diagnostic ignored "-Wduplicated-branches"
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SECTION:hash_tables
|
* SECTION:hash_tables
|
||||||
|
Loading…
Reference in New Issue
Block a user