+2020-07-30 Paul Eggert <eggert@cs.ucla.edu>
+
+ Work around some Oracle Studio attribute bugs
+ These were discovered when building bleeding-edge Emacs with
+ Oracle Studio.
+ * m4/gnulib-common.m4 (_GL_ATTRIBUTE_COLD, _GL_ATTRIBUTE_MAY_ALIAS):
+ Port to Oracle Studio 12.6, which mishandles __attribute__
+ ((__cold__)) and __attribute__ ((__may_alias__)) even though
+ __has_attribute says they work.
+
2020-07-29 Bruno Haible <bruno@clisp.org>
unicodeio: Fix wrong result on musl libc.
#endif
/* Avoid __attribute__ ((cold)) on MinGW; see thread starting at
- <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>. */
+ <https://lists.gnu.org/r/emacs-devel/2019-04/msg01152.html>.
+ Also, Oracle Studio 12.6 requires 'cold' not '__cold__'. */
#if _GL_HAS_ATTRIBUTE (cold) && !defined __MINGW32__
-# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# ifndef __SUNPRO_C
+# define _GL_ATTRIBUTE_COLD __attribute__ ((__cold__))
+# else
+# define _GL_ATTRIBUTE_COLD __attribute__ ((cold))
+# endif
#else
# define _GL_ATTRIBUTE_COLD
#endif
# define _GL_ATTRIBUTE_LEAF
#endif
-#if _GL_HAS_ATTRIBUTE (may_alias)
+/* Oracle Studio 12.6 mishandles may_alias despite __has_attribute OK. */
+#if _GL_HAS_ATTRIBUTE (may_alias) && !defined __SUNPRO_C
# define _GL_ATTRIBUTE_MAY_ALIAS __attribute__ ((__may_alias__))
#else
# define _GL_ATTRIBUTE_MAY_ALIAS