bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: Re: test-simple-atomic.c compilation error on Solaris
Date: Fri, 19 Mar 2021 03:51:05 +0100	[thread overview]
Message-ID: <1905210.KEeumH3cFL@omega> (raw)
In-Reply-To: <7ccb90d4-400f-10e8-bb06-1b002fcc836e@jupiterrise.com>

Hi Tom,

> The test-simple-atomic test is failing to build on Solaris (tested 10 
> and older).
> 
> Here's the error from Solaris 10:
> 
> make[3]: Entering directory 
> `/export/home/tgc/tmp/daily_build/gnulib/000-gnulib-simple-363497c93/gltests'
> depbase=`echo test-simple-atomic.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
> /usr/tgcware/gcc9/bin/gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. 
> -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I. -I.. -I./.. 
> -I../gllib -I./../gllib -I/usr/tgcware/include -D_REENTRANT  -g -O2 -MT 
> test-simple-atomic.o -MD -MP -MF $depbase.Tpo -c -o test-simple-atomic.o 
> test-simple-atomic.c &&\
> mv -f $depbase.Tpo $depbase.Po
> In file included from ../gllib/unistd.h:40,
>                   from ../gllib/stdlib.h:100,
>                   from ../gllib/glthread/thread.h:74,
>                   from test-simple-atomic.c:43:
> /usr/include/unistd.h:542:23: error: macro "yield" passed 1 arguments, 
> but takes just 0
>    542 | extern void yield(void);
>        |                       ^
> test-simple-atomic.c:38: note: macro "yield" defined here
>     38 | # define yield() gl_thread_yield ()
>        |
> make[3]: *** [test-simple-atomic.o] Error 1
> make[3]: Target `check-am' not remade because of errors.

I can reproduce it with a testdir of all of gnulib.
This patch fixes it.


2021-03-18  Bruno Haible  <bruno@clisp.org>

	simple-atomic tests: Fix compilation error on Solaris 10.
	Reported by Tom G. Christensen <tgc@jupiterrise.com> in
	<https://lists.gnu.org/archive/html/bug-gnulib/2021-03/msg00085.html>.
	* tests/test-simple-atomic.c (yield): Define only after all #includes.

diff --git a/tests/test-simple-atomic.c b/tests/test-simple-atomic.c
index 04baf05..e30506a 100644
--- a/tests/test-simple-atomic.c
+++ b/tests/test-simple-atomic.c
@@ -34,17 +34,17 @@
    implementation.  */
 #define REPEAT_COUNT 1000
 
+#include "glthread/thread.h"
+#include "glthread/yield.h"
+
+#include "macros.h"
+
 #if EXPLICIT_YIELD
 # define yield() gl_thread_yield ()
 #else
 # define yield()
 #endif
 
-#include "glthread/thread.h"
-#include "glthread/yield.h"
-
-#include "macros.h"
-
 /* Counters for each thread.  */
 static unsigned int counter[THREAD_COUNT][5];
 



      reply	other threads:[~2021-03-19  2:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-18 19:41 test-simple-atomic.c compilation error on Solaris Tom G. Christensen
2021-03-19  2:51 ` Bruno Haible [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1905210.KEeumH3cFL@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).