Problem: pragma diagnostic is new in GCC 4.2

Solution: check for GCC version before using pragma diagnostic
in tweetnacl to avoid an additional warning.
This commit is contained in:
Luca Boccassi 2016-04-12 23:52:34 +01:00
parent 71050259f7
commit 3945f27f6d
2 changed files with 2 additions and 2 deletions

View File

@ -11,7 +11,7 @@ Public domain.
Disable warnings for this source only, rather than for the whole
codebase when building with C99 or with Microsoft's compiler
*/
#if defined __GNUC__ && __STDC_VERSION__ < 201112L
#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && __STDC_VERSION__ < 201112L
# pragma GCC diagnostic ignored "-Wsign-compare"
#elif defined _MSC_VER
# pragma warning (disable:4018 4244 4146)

View File

@ -5,7 +5,7 @@
Disable warnings for this source only, rather than for the whole
codebase when building with C99 or with Microsoft's compiler
*/
#if defined __GNUC__ && __STDC_VERSION__ < 201112L
#if defined __GNUC__ && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) && __STDC_VERSION__ < 201112L
# pragma GCC diagnostic ignored "-Wsign-compare"
#elif defined _MSC_VER
# pragma warning (disable:4018 4244 4146)