On 9/13/21 7:11 AM, Eric Blake wrote:

I'm not sure how much of gnulib still tries to cater to C89,
vs. assuming C99.

Gnulib no longer bothers with porting back to C89. However, this issue is due to a C99 compiler being pedantic, so we should fix it. I installed the attached into Gnulib on Savannah; please give it a try. With this patch, on my Solaris 10 sparc platform, Oracle Developer Studio 12.6 c99 issues a warning but it is not fatal, and that should be good enough.
>From 3c42acd3b4e5941776bc45d529abf5687f9088ff Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Mon, 13 Sep 2021 11:12:54 -0700
Subject: [PATCH] asyncsafe-spin: port to Oracle Studio 12.6 sparc

Problem reported by Dennis Clarke via Eric Blake in:
https://lists.gnu.org/r/bug-gnulib/2021-09/msg00056.html
* lib/asyncsafe-spin.c (asm) [0x590 <= __SUNPRO_C && __STDC__]:
#define to __asm.
---
 ChangeLog            | 8 ++++++++
 lib/asyncsafe-spin.c | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index d64252c38..6641ed9f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-09-13  Paul Eggert  <egg...@cs.ucla.edu>
+
+	asyncsafe-spin: port to Oracle Studio 12.6 sparc
+	Problem reported by Dennis Clarke via Eric Blake in:
+	https://lists.gnu.org/r/bug-gnulib/2021-09/msg00056.html
+	* lib/asyncsafe-spin.c (asm) [0x590 <= __SUNPRO_C && __STDC__]:
+	#define to __asm.
+
 2021-09-12  Paul Eggert  <egg...@cs.ucla.edu>
 
 	stdint-tests: long long preproc on recent Sun C
diff --git a/lib/asyncsafe-spin.c b/lib/asyncsafe-spin.c
index 870b7a21b..3771c4c0e 100644
--- a/lib/asyncsafe-spin.c
+++ b/lib/asyncsafe-spin.c
@@ -27,6 +27,10 @@
 # include <sys/atomic_op.h>
 #endif
 
+#if 0x590 <= __SUNPRO_C && __STDC__
+# define asm __asm
+#endif
+
 #if defined _WIN32 && ! defined __CYGWIN__
 /* Use Windows threads.  */
 
-- 
2.30.2

Reply via email to