From 5695fa0d628b85ee233d66ccb9d07ea7e962294d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 30 Sep 2023 20:59:24 +0200 Subject: [PATCH] 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. --- gettext-runtime/intl/localealias.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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; -- 2.47.3