bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

localcharset: Avoid internal compiler error with -Wextra on macOS 10.5


From: Bruno Haible
Subject: localcharset: Avoid internal compiler error with -Wextra on macOS 10.5
Date: Tue, 03 Oct 2023 00:15:01 +0200

On Mac OS X 10.5.x, with the default compiler ("gcc version 4.0.1
(Apple Inc. build 5465)"), I see this compilation error:

$ gcc -std=gnu99 -DHAVE_CONFIG_H -DNO_XMALLOC -I. 
-I../../../../gettext-runtime/intl/gnulib-lib -I.. -DIN_LIBRARY 
-DINSTALLDIR=\"/Users/bruno/data/local-macos/lib\" -DNO_XMALLOC -DBUILDING_DLL 
-Dset_relocation_prefix=libintl_set_relocation_prefix -DDEPENDS_ON_LIBICONV=1 
-I/Users/bruno/data/local-macos/include -c 
../../../../gettext-runtime/intl/gnulib-lib/localcharset.c  -fno-common -DPIC 
-o .libs/libgnu_la-localcharset.o -Wextra
../../../../gettext-runtime/intl/gnulib-lib/localcharset.c: In function 
‘locale_charset’:
../../../../gettext-runtime/intl/gnulib-lib/localcharset.c:1057: internal 
compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://developer.apple.com/bugreporter> for instructions.

According to the description of '-Wextra' in
https://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Warning-Options.html
the ICE probably happens when the compiler is about to warn about the
null statement. This trivial change allows the compilation to succeed:


2023-10-02  Bruno Haible  <bruno@clisp.org>

        localcharset: Avoid internal compiler error with -Wextra on macOS 10.5.
        * lib/localcharset.c (locale_charset): Use an empty compound statement
        instead of a null statement.

diff --git a/lib/localcharset.c b/lib/localcharset.c
index 7ed9c957db..70a29baf3f 100644
--- a/lib/localcharset.c
+++ b/lib/localcharset.c
@@ -1054,7 +1054,7 @@ locale_charset (void)
           }
       }
     if (0)
-      done_table_lookup: ;
+      done_table_lookup: {}
     else
 # endif
       {






reply via email to

[Prev in Thread] Current Thread [Next in Thread]