]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
build: Fix a compilation failure on AIX with gcc 10.
authorBruno Haible <bruno@clisp.org>
Wed, 15 Nov 2023 15:11:34 +0000 (16:11 +0100)
committerBruno Haible <bruno@clisp.org>
Wed, 15 Nov 2023 17:45:39 +0000 (18:45 +0100)
* m4/more-warnings.m4 (gt_MORE_WARNINGS): Turn off -fanalyzer with GCC 10
or older.

m4/more-warnings.m4

index 42c168b10ecfca3b4c5f1d3fdee0ab2e0c3b9d7a..d223aa2b33e7c5b304d3d1320f0bf21162c4f22c 100644 (file)
@@ -1,4 +1,4 @@
-# more-warnings.m4 serial 1 (gettext-0.21.2)
+# more-warnings.m4 serial 1.1 (gettext-0.22.4)
 dnl Copyright (C) 2023 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -166,6 +166,20 @@ AS_HELP_STRING([[--disable-more-warnings]], [obey exactly the warning options sp
     dnl Cf. -Wshadow, above.
     gl_WARN_ADD([-Wshadow=local])
 
+    dnl With GCC 10 and older, turn off -fanalyzer, because it requires too much
+    dnl memory in the compiler.
+    dnl See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97240>. In particular,
+    dnl on AIX 7.3, gcc 10.3 cannot compile regex.c with -fanalyzer:
+    dnl cc1: out of memory allocating 732 bytes after a total of 1072239104 bytes
+    AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+      #if __GNUC__ > 10
+      #error "You are lucky"
+      #endif
+      ]])],
+      [
+        gl_WARN_ADD([-fno-analyzer])
+      ])
+
     dnl For production code imported from other packages, disable some other
     dnl warnings. For imported code, I want to minimize difference w.r.t.
     dnl upstream.