bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: "Martin Storsjö" <martin@martin.st>
To: Bruno Haible <bruno@clisp.org>
Cc: bug-gnulib@gnu.org
Subject: Re: isnan function conflicts with C++ standard library declarations
Date: Wed, 28 Aug 2019 22:51:48 +0300 (EEST)	[thread overview]
Message-ID: <alpine.DEB.2.20.1908282250090.6969@cone.martin.st> (raw)
In-Reply-To: <4751172.Ro3qupbQrl@omega>

Hi Bruno,

On Wed, 28 Aug 2019, Bruno Haible wrote:

> Hi Martin,
>
>> Well in addition to macOS, I can also still reproduce the issue on Linux
>> (Ubuntu 18.04, with its default GCC 7) as well, so maybe it's an issue
>> with newer C++ standard headers, regardless of platform?
>
> Indeed. I can reproduce it with GCC >= 6. And since clang sometimes uses the
> C++ header files from GCC, we also have to enable the workaround for clang.
> It is apparently not needed with AIX xlc, HP-UX cc, Solaris cc.
>
> Fixed by changing the condition to
>  #if __GNUC__ >= 6 || defined __clang__

Thanks! That should probably work, and good to know in which GCC version 
this changed.

>>>> This issue can crop up e.g. when trying to build gettext for mingw (which
>>>> has got the gnulib isnan function bundled, even if it isn't used).
>>>
>>> I'm regularly building gettext on mingw and haven't seen this issue. Therefore
>>> thanks again for the reproduction example.
>>
>> I ran into it while trying to build gettext with clang (with my pure-llvm
>> based toolchain, at https://github.com/mstorsjo/llvm-mingw in case you're
>> interested), so I presume there's something that goes different in gettext
>> with clang/lld compared to gcc
>
> Yes. It would make sense to compare the config.status file generated by an llvm
> build with those generated by a gcc build.

Thanks for the pointers - I'll see if I'll dig further into that to see 
what the differences stem from.

>> I only run into it
>> if building a shared gettext, not with a static-only build, for some
>> reason.
>
> The reason is that gettext is written in C, and only a few files are getting
> compiled by a C++ compiler, as a workaround to a problem with DLL import of
> variables and variable initializers. This workaround is not enabled when
> --disable-shared is specified.

Ah, thanks, that explains things a bit.

// Martin



  reply	other threads:[~2019-08-28 20:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27 20:21 isnan function conflicts with C++ standard library declarations Martin Storsjö
2019-08-28  8:46 ` Bruno Haible
2019-08-28 10:22   ` Martin Storsjö
2019-08-28 16:13     ` Bruno Haible
2019-08-28 19:51       ` Martin Storsjö [this message]
2019-08-29 18:55       ` Martin Storsjö
2019-08-29 22:02         ` Bruno Haible

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=alpine.DEB.2.20.1908282250090.6969@cone.martin.st \
    --to=martin@martin.st \
    --cc=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).