From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: Sandra Loosemore <sandra@codesourcery.com>,
Gerald Pfeifer <gerald@pfeifer.com>,
Andreas Tobler <andreast@freebsd.org>,
gcc-patches@gcc.gnu.org, fortran@gcc.gnu.org
Subject: Re: [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h
Date: Mon, 13 Sep 2021 19:20:48 +0200 [thread overview]
Message-ID: <20210913172048.GK304296@tucnak> (raw)
In-Reply-To: <b21bd3e2-c3a0-bd4a-3238-1fe0984daaba@codesourcery.com>
On Mon, Sep 13, 2021 at 07:07:01PM +0200, Tobias Burnus wrote:
> Regarding FreeBSD: Does this output different values? – If yes, we know
> what to do, otherwise – hmm.
>
> [...]
>
> > > Wouldn't it be better to use the __LDBL_* macros anyway and not rely on
> > > float.h? The header doesn't want to test what float.h tells about the
> > > long double type, but what the compiler knows about it.
> > I originally wrote the code to use the internal GCC __LDBL_* macros as
> > you suggest, but Tobias complained that then the gfortran-provided .h
> > file could not be used to compile the C parts of the program with some
> > other C compiler.
> For instance, clang does not seem to provide those - and in some cases,
> it can be useful to mix gfortran code with code complied by other
> compilers (icc, clang, ...).
> > Maybe it needs to first check the internal macros and then look for
> > the float.h versions if it can't find them?
>
> I think that makes sense. (Adding a comment that #include <float.h> is
> for non-GCC compilers, only.)
At least according to godbolt and my tests, both clang and icc predefine
those macros too. But there are other C compilers, sure.
So we'd need #if defined (__LDBL_MAX__) && defined (__LDBL_*_) // whatever
we need
#else
#include <float.h>
...
#endif
or so.
Jakub
next prev parent reply other threads:[~2021-09-13 17:21 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-19 2:57 Sandra Loosemore
2021-09-03 2:05 ` PING " Sandra Loosemore
2021-09-06 19:29 ` Tobias Burnus
2021-09-10 15:39 ` Andreas Schwab
2021-09-13 7:51 ` Tobias Burnus
2021-09-13 15:56 ` Gerald Pfeifer
2021-09-13 16:32 ` Tobias Burnus
2021-09-13 16:51 ` Jakub Jelinek
2021-09-13 16:59 ` Sandra Loosemore
2021-09-13 17:07 ` Tobias Burnus
2021-09-13 17:20 ` Jakub Jelinek [this message]
2021-09-14 3:39 ` Sandra Loosemore
2021-09-14 7:39 ` Tobias Burnus
2021-09-14 16:34 ` Gerald Pfeifer
2021-09-14 14:50 ` Gerald Pfeifer
2021-09-14 15:16 ` Tobias Burnus
2021-09-14 15:17 ` Andreas Schwab
2021-09-14 15:23 ` Jakub Jelinek
2021-09-14 15:30 ` Andreas Schwab
2021-09-15 1:05 ` Joseph Myers
2021-09-14 19:27 ` Gerald Pfeifer
2021-09-17 6:03 ` Gerald Pfeifer
2021-09-17 14:10 ` [committed] Fortran: Prefer GCC internal macros to float.h in ISO_Fortran_binding.h (was: [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h) Tobias Burnus
2021-09-18 4:51 ` Gerald Pfeifer
2021-09-13 17:39 ` [PATCH, Fortran] Revert to non-multilib-specific ISO_Fortran_binding.h Andreas Schwab
2021-09-13 18:07 ` Jakub Jelinek
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210913172048.GK304296@tucnak \
--to=jakub@redhat.com \
--cc=andreast@freebsd.org \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=gerald@pfeifer.com \
--cc=sandra@codesourcery.com \
--cc=tobias@codesourcery.com \
/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).