From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: ilogbl: Fix compilation error with xlclang on AIX 7.2
Date: Wed, 06 Jan 2021 12:02:15 +0100 [thread overview]
Message-ID: <6391614.DLc82tpyLq@omega> (raw)
On AIX 7.2 with xlclang in 64-bit mode I see this compilation error:
xlclang -q64 -qthreaded -qtls -std=gnu11 -DHAVE_CONFIG_H -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -I/home/haible/prefix64/include -D_THREAD_SAFE -g -O2 -MT math.o -MD -MP -MF .deps/math.Tpo -c -o math.o ../../gllib/math.c
In file included from ../../gllib/math.c:3:
./math.h:1832:19: error: function cannot return function type 'int (long double)'
_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
^
1 error generated.
The reason is that in this situation, 'ilogbl' is defined as a macro.
This patch fixes it.
2021-01-06 Bruno Haible <bruno@clisp.org>
ilogbl: Fix compilation error with xlclang on AIX 7.2.
* lib/math.in.h (ilogbl): Undefine macro before declaration.
diff --git a/lib/math.in.h b/lib/math.in.h
index 6208a01..335505d 100644
--- a/lib/math.in.h
+++ b/lib/math.in.h
@@ -1322,6 +1322,7 @@ _GL_FUNCDECL_RPL (ilogbl, int, (long double x));
_GL_CXXALIAS_RPL (ilogbl, int, (long double x));
# else
# if !@HAVE_ILOGBL@
+# undef ilogbl
_GL_FUNCDECL_SYS (ilogbl, int, (long double x));
# endif
_GL_CXXALIAS_SYS (ilogbl, int, (long double x));
@@ -2102,7 +2103,7 @@ _GL_FUNCDECL_RPL (sinf, float, (float x));
_GL_CXXALIAS_RPL (sinf, float, (float x));
# else
# if !@HAVE_SINF@
- # undef sinf
+# undef sinf
_GL_FUNCDECL_SYS (sinf, float, (float x));
# endif
_GL_CXXALIAS_SYS (sinf, float, (float x));
reply other threads:[~2021-01-06 11:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=6391614.DLc82tpyLq@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).