bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* Fix compilation errors in C++ mode on Solaris 11 OpenIndiana
@ 2022-12-27 10:33 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2022-12-27 10:33 UTC (permalink / raw)
  To: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 4782 bytes --]

The newest Solaris OpenIndiana release (OpenIndiana 2022.10) comes with
GCC 11. Therefore the _GL_ATTRIBUTE_DEALLOC and _GL_ATTRIBUTE_DEALLOC_FREE
macros start to be effective on this platform. A gnulib testdir shows a
couple of compilation errors in C++ files, see attached file 'log2b'.

I could reduce the input file to this small one:
=============================== i.cc ===============================
extern "C" {
namespace std {
extern void free(void *);
}
}
using std::free;
extern "C" {
extern wchar_t *wcsdup(const wchar_t *);
}
extern "C" void free (void *);
extern "C" wchar_t * wcsdup (const wchar_t *s) 
__attribute__ ((__malloc__)) __attribute__ ((__malloc__ (free, 1)));
====================================================================
$ g++ -S i.cc
i.cc:12:67: error: ‘malloc’ attribute argument 1 is ambiguous
   12 | __attribute__ ((__malloc__)) __attribute__ ((__malloc__ (free, 1)))
      |                                                                   ^
i.cc:12:67: note: use a cast to the expected type to disambiguate

It's a g++ bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231

There are three possible workarounds:
(1) Write
       __attribute__ ((__malloc__ ((void (*) (void *)) free, 1)))
    instead of
       __attribute__ ((__malloc__ (free, 1)))
(2) Use the command-line option -fno-builtin.
(3) Swap the order of declarations of 'free'.

I'm going with (1), since (2) is not good for production code and (3) is
hairy (depends on which include file gets included first, and what the
system include files contain).


2022-12-27  Bruno Haible  <bruno@clisp.org>

	Fix compilation errors in C++ mode on Solaris 11 OpenIndiana.
	* m4/gnulib-common.m4 (gl_COMMON_BODY): In _GL_ATTRIBUTE_DEALLOC_FREE,
	with GNU C++, cast the 'free' function.
	* lib/string.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): With GNU C++, cast the
	'free' function.
	* lib/wchar.in.h (_GL_ATTRIBUTE_DEALLOC_FREE): Likewise.

diff --git a/m4/gnulib-common.m4 b/m4/gnulib-common.m4
index 728a006ce8..40c19cab69 100644
--- a/m4/gnulib-common.m4
+++ b/m4/gnulib-common.m4
@@ -1,4 +1,4 @@
-# gnulib-common.m4 serial 74
+# gnulib-common.m4 serial 75
 dnl Copyright (C) 2007-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -187,7 +187,14 @@ AC_DEFUN([gl_COMMON_BODY], [
    to use this earlier definition, since <stdlib.h> may not have been included
    yet.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
 #endif
 
 /* _GL_ATTRIBUTE_DEPRECATED: Declares that an entity is deprecated.
diff --git a/lib/string.in.h b/lib/string.in.h
index 21356914e2..64a0ab19f7 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -82,7 +82,14 @@
    can be freed via 'free'; it can be used only after declaring 'free'.  */
 /* Applies to: functions.  Cannot be used on inline functions.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
 #endif
 
 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly
diff --git a/lib/wchar.in.h b/lib/wchar.in.h
index 3558adfb9d..70b8d7d259 100644
--- a/lib/wchar.in.h
+++ b/lib/wchar.in.h
@@ -99,7 +99,14 @@
    can be freed via 'free'; it can be used only after declaring 'free'.  */
 /* Applies to: functions.  Cannot be used on inline functions.  */
 #ifndef _GL_ATTRIBUTE_DEALLOC_FREE
-# define _GL_ATTRIBUTE_DEALLOC_FREE _GL_ATTRIBUTE_DEALLOC (free, 1)
+# if defined __cplusplus && defined __GNUC__ && !defined __clang__
+/* Work around GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108231> */
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC ((void (*) (void *)) free, 1)
+# else
+#  define _GL_ATTRIBUTE_DEALLOC_FREE \
+     _GL_ATTRIBUTE_DEALLOC (free, 1)
+# endif
 #endif
 
 /* _GL_ATTRIBUTE_MALLOC declares that the function returns a pointer to freshly

[-- Attachment #2: log2b --]
[-- Type: text/plain, Size: 31491 bytes --]

make  all-recursive
Making all in gllib
make  all-recursive
Making all in glm4
Making all in gltests
## ---------------------------------------------------- ##
## ------------------- Gnulib tests ------------------- ##
## You can ignore compiler warnings in this directory.  ##
## ---------------------------------------------------- ##
make  all-recursive
Making all in .
depbase=`echo test-list-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-list-c++.o -MD -MP -MF $depbase.Tpo -c -o test-list-c++.o ../../gltests/test-list-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/sys/wait.h:37,
                 from ../gllib/sys/wait.h:28,
                 from /usr/include/stdlib.h:45,
                 from /usr/gcc/11/include/c++/11.3.0/cstdlib:75,
                 from /usr/gcc/11/include/c++/11.3.0/stdlib.h:36,
                 from ../gllib/stdlib.h:36,
                 from ../../gltests/../gllib/xalloc.h:22,
                 from ../../gltests/../gllib/gl_xlist.h:22,
                 from ../../gltests/../gllib/gl_list.hh:22,
                 from ../../gltests/test-list-c++.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-locale-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-locale-c++.o -MD -MP -MF $depbase.Tpo -c -o test-locale-c++.o ../../gltests/test-locale-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from /usr/include/xlocale.h:38,
                 from ../gllib/locale.h:53,
                 from ../../gltests/test-locale-c++.cc:22:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-locale-c++2.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-locale-c++2.o -MD -MP -MF $depbase.Tpo -c -o test-locale-c++2.o ../../gltests/test-locale-c++2.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from /usr/include/xlocale.h:38,
                 from ../gllib/locale.h:53,
                 from /usr/gcc/11/include/c++/11.3.0/clocale:42,
                 from ../../gltests/test-locale-c++2.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-map-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-map-c++.o -MD -MP -MF $depbase.Tpo -c -o test-map-c++.o ../../gltests/test-map-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/sys/wait.h:37,
                 from ../gllib/sys/wait.h:28,
                 from /usr/include/stdlib.h:45,
                 from /usr/gcc/11/include/c++/11.3.0/cstdlib:75,
                 from /usr/gcc/11/include/c++/11.3.0/stdlib.h:36,
                 from ../gllib/stdlib.h:36,
                 from ../../gltests/../gllib/xalloc.h:22,
                 from ../../gltests/../gllib/gl_xmap.h:22,
                 from ../../gltests/../gllib/gl_map.hh:22,
                 from ../../gltests/test-map-c++.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-monetary-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-monetary-c++.o -MD -MP -MF $depbase.Tpo -c -o test-monetary-c++.o ../../gltests/test-monetary-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/monetary.h:33,
                 from ../gllib/monetary.h:27,
                 from ../../gltests/test-monetary-c++.cc:23:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-omap-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-omap-c++.o -MD -MP -MF $depbase.Tpo -c -o test-omap-c++.o ../../gltests/test-omap-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/sys/wait.h:37,
                 from ../gllib/sys/wait.h:28,
                 from /usr/include/stdlib.h:45,
                 from /usr/gcc/11/include/c++/11.3.0/cstdlib:75,
                 from /usr/gcc/11/include/c++/11.3.0/stdlib.h:36,
                 from ../gllib/stdlib.h:36,
                 from ../../gltests/../gllib/xalloc.h:22,
                 from ../../gltests/../gllib/gl_xomap.h:22,
                 from ../../gltests/../gllib/gl_omap.hh:22,
                 from ../../gltests/test-omap-c++.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-oset-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-oset-c++.o -MD -MP -MF $depbase.Tpo -c -o test-oset-c++.o ../../gltests/test-oset-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/sys/wait.h:37,
                 from ../gllib/sys/wait.h:28,
                 from /usr/include/stdlib.h:45,
                 from /usr/gcc/11/include/c++/11.3.0/cstdlib:75,
                 from /usr/gcc/11/include/c++/11.3.0/stdlib.h:36,
                 from ../gllib/stdlib.h:36,
                 from ../../gltests/../gllib/xalloc.h:22,
                 from ../../gltests/../gllib/gl_xoset.h:22,
                 from ../../gltests/../gllib/gl_oset.hh:22,
                 from ../../gltests/test-oset-c++.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-set-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-set-c++.o -MD -MP -MF $depbase.Tpo -c -o test-set-c++.o ../../gltests/test-set-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from /usr/include/sys/wait.h:37,
                 from ../gllib/sys/wait.h:28,
                 from /usr/include/stdlib.h:45,
                 from /usr/gcc/11/include/c++/11.3.0/cstdlib:75,
                 from /usr/gcc/11/include/c++/11.3.0/stdlib.h:36,
                 from ../gllib/stdlib.h:36,
                 from ../../gltests/../gllib/xalloc.h:22,
                 from ../../gltests/../gllib/gl_xset.h:22,
                 from ../../gltests/../gllib/gl_set.hh:22,
                 from ../../gltests/test-set-c++.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-stdalign-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-stdalign-c++.o -MD -MP -MF $depbase.Tpo -c -o test-stdalign-c++.o ../../gltests/test-stdalign-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from /usr/gcc/11/include/c++/11.3.0/cwchar:44,
                 from /usr/gcc/11/include/c++/11.3.0/bits/postypes.h:40,
                 from /usr/gcc/11/include/c++/11.3.0/iosfwd:40,
                 from /usr/gcc/11/include/c++/11.3.0/ios:38,
                 from /usr/gcc/11/include/c++/11.3.0/ostream:38,
                 from /usr/gcc/11/include/c++/11.3.0/iostream:39,
                 from ../../gltests/test-stdalign-c++.cc:26:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-uchar-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-uchar-c++.o -MD -MP -MF $depbase.Tpo -c -o test-uchar-c++.o ../../gltests/test-uchar-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdint.h:105,
                 from ../gllib/uchar.h:44,
                 from ../../gltests/test-uchar-c++.cc:22:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-uchar-c++2.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-uchar-c++2.o -MD -MP -MF $depbase.Tpo -c -o test-uchar-c++2.o ../../gltests/test-uchar-c++2.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from /usr/gcc/11/include/c++/11.3.0/cwchar:44,
                 from /usr/gcc/11/include/c++/11.3.0/cuchar:49,
                 from ../../gltests/test-uchar-c++2.cc:22:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-wchar-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-wchar-c++.o -MD -MP -MF $depbase.Tpo -c -o test-wchar-c++.o ../../gltests/test-wchar-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from ../../gltests/test-wchar-c++.cc:22:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-wchar-c++2.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-wchar-c++2.o -MD -MP -MF $depbase.Tpo -c -o test-wchar-c++2.o ../../gltests/test-wchar-c++2.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from /usr/gcc/11/include/c++/11.3.0/cwchar:44,
                 from ../../gltests/test-wchar-c++2.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-wchar-c++3.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-wchar-c++3.o -MD -MP -MF $depbase.Tpo -c -o test-wchar-c++3.o ../../gltests/test-wchar-c++3.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from ../../gltests/test-wchar-c++3.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-wctype-h-c++.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-wctype-h-c++.o -MD -MP -MF $depbase.Tpo -c -o test-wctype-h-c++.o ../../gltests/test-wctype-h-c++.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from ../gllib/wctype.h:50,
                 from ../../gltests/test-wctype-h-c++.cc:22:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
depbase=`echo test-wctype-h-c++2.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -m64 -O2 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I..   -DGNULIB_STRICT_CHECKING=1  -DIN_GNULIB_TESTS=1  -I. -I../../gltests  -I.. -I../../gltests/..  -I../gllib -I../../gltests/../gllib -I/export/home/bruno/prefix64gcc/include -Wall -D_REENTRANT  -Wno-error -g -O2 -MT test-wctype-h-c++2.o -MD -MP -MF $depbase.Tpo -c -o test-wctype-h-c++2.o ../../gltests/test-wctype-h-c++2.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from /usr/include/sys/time.h:481,
                 from ../gllib/sys/time.h:39,
                 from /usr/include/sys/select.h:53,
                 from ../gllib/sys/select.h:36,
                 from /usr/include/sys/types.h:662,
                 from ../gllib/sys/types.h:39,
                 from ../gllib/stdio.h:58,
                 from /usr/include/iso/wchar_iso.h:54,
                 from /usr/include/wchar.h:31,
                 from ../gllib/wchar.h:80,
                 from ../gllib/wctype.h:50,
                 from /usr/gcc/11/include/c++/11.3.0/cwctype:50,
                 from ../../gltests/test-wctype-h-c++2.cc:20:
../config.h:7313:72: error: 'malloc' attribute argument 1 is ambiguous
 7313 | # define _GL_ATTRIBUTE_DEALLOC(f, i) __attribute__ ((__malloc__ (f, i)))
      |                                                                        ^
../config.h:7313:72: note: use a cast to the expected type to disambiguate
*** Error code 1
make: Warning: Target `all-am' not remade because of errors
Current working directory /export/home/bruno/testdir-all/build-64-gcc/gltests
*** Error code 1
The following command caused the error:
fail=; \
if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_with_option: internal error: invalid"  "target option '${target_option-}' specified" >&2;  exit 1;;  esac;  has_opt=no;  sane_makeflags=$MAKEFLAGS;  if {  if test -z '3'; then  false;  elif test -n ''; then  true;  elif test -n '' && test -n ''; then  true;  else  false;  fi;  }; then  sane_makeflags=$MFLAGS;  else  case $MAKEFLAGS in  *\\[\ \	]*)  bs=\\;  sane_makeflags=`printf '%s\n' "$MAKEFLAGS"  | sed "s/$bs$bs[$bs $bs	]*//g"`;;  esac;  fi;  skip_next=no;  strip_trailopt ()  {  flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;  };  for flg in $sane_makeflags; do  test $skip_next = yes && { skip_next=no; continue; };  case $flg in  *=*|--*) continue;;  -*I) strip_trailopt 'I'; skip_next=yes;;  -*I?*) strip_trailopt 'I';;  -*O) strip_trailopt 'O'; skip_next=yes;;  -*O?*) strip_trailopt 'O';;  -*l) strip_trailopt 'l'; skip_next=yes;;  -*l?*) strip_trailopt 'l';;  -[dEDm]) skip_next=yes;;  -[JT]) skip_next=yes;;  esac;  case $flg in  *$target_option*) has_opt=yes; break;;  esac;  done;  test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='.' ;; \
  *) list='.' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Warning: Target `all-recursive' not remade because of errors
Current working directory /export/home/bruno/testdir-all/build-64-gcc/gltests
*** Error code 1
make: Warning: Target `all' not remade because of errors
Current working directory /export/home/bruno/testdir-all/build-64-gcc/gltests
*** Error code 1
The following command caused the error:
fail=; \
if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_with_option: internal error: invalid"  "target option '${target_option-}' specified" >&2;  exit 1;;  esac;  has_opt=no;  sane_makeflags=$MAKEFLAGS;  if {  if test -z '1'; then  false;  elif test -n ''; then  true;  elif test -n '' && test -n ''; then  true;  else  false;  fi;  }; then  sane_makeflags=$MFLAGS;  else  case $MAKEFLAGS in  *\\[\ \	]*)  bs=\\;  sane_makeflags=`printf '%s\n' "$MAKEFLAGS"  | sed "s/$bs$bs[$bs $bs	]*//g"`;;  esac;  fi;  skip_next=no;  strip_trailopt ()  {  flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;  };  for flg in $sane_makeflags; do  test $skip_next = yes && { skip_next=no; continue; };  case $flg in  *=*|--*) continue;;  -*I) strip_trailopt 'I'; skip_next=yes;;  -*I?*) strip_trailopt 'I';;  -*O) strip_trailopt 'O'; skip_next=yes;;  -*O?*) strip_trailopt 'O';;  -*l) strip_trailopt 'l'; skip_next=yes;;  -*l?*) strip_trailopt 'l';;  -[dEDm]) skip_next=yes;;  -[JT]) skip_next=yes;;  esac;  case $flg in  *$target_option*) has_opt=yes; break;;  esac;  done;  test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='gllib glm4 gltests' ;; \
  *) list='gllib glm4 gltests' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Warning: Target `all-recursive' not remade because of errors
Current working directory /export/home/bruno/testdir-all/build-64-gcc
*** Error code 1
make: Warning: Target `all' not remade because of errors

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-12-27 10:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-27 10:33 Fix compilation errors in C++ mode on Solaris 11 OpenIndiana Bruno Haible

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).