From: Bruno Haible Date: Sat, 30 Sep 2023 18:59:24 +0000 (+0200) Subject: intl: Fix portability problem in previous commit. X-Git-Tag: v0.23~338 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5695fa0d628b85ee233d66ccb9d07ea7e962294d;p=thirdparty%2Fgettext.git intl: Fix portability problem in previous commit. * gettext-runtime/intl/localealias.c (read_alias_file): Use "#pragma GCC diagnostic ..." only with new enough GCC versions. --- diff --git a/gettext-runtime/intl/localealias.c b/gettext-runtime/intl/localealias.c index d1de252ba..3953312c5 100644 --- a/gettext-runtime/intl/localealias.c +++ b/gettext-runtime/intl/localealias.c @@ -363,13 +363,12 @@ read_alias_file (const char *fname, int fname_len) if (string_space_act + alias_len + value_len > string_space_max) { -#pragma GCC diagnostic push - -#if defined __GNUC__ && __GNUC__ >= 12 +# if defined __GNUC__ && __GNUC__ >= 12 +# pragma GCC diagnostic push /* Suppress the valid GCC 12 warning until the code below is changed to avoid using pointers to the reallocated block. */ # pragma GCC diagnostic ignored "-Wuse-after-free" -#endif +# endif /* Increase size of memory pool. */ size_t new_size = (string_space_max @@ -404,7 +403,9 @@ read_alias_file (const char *fname, int fname_len) value, value_len); string_space_act += value_len; -#pragma GCC diagnostic pop +# if defined __GNUC__ && __GNUC__ >= 12 +# pragma GCC diagnostic pop +# endif ++nmap; ++added;