From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: jhb@freebsd.org (John Baldwin)
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC v2][2/2] Target FP: Make use of MPFR if available
Date: Wed, 29 Nov 2017 17:55:00 -0000 [thread overview]
Message-ID: <20171129175536.A27B8D80320@oc3748833570.ibm.com> (raw)
In-Reply-To: <1983636.dILOnyREsD@ralph.baldwin.cx> from "John Baldwin" at Nov 28, 2017 04:36:57 PM
John Baldwin wrote:
> FreeBSD's stdint.h uses _SYS_STDINT_H_ as it's include guard for <stdint.h>,
> so this check doesn't work. Perhaps GDB's sources should just define
> MPFR_USE_INTMAX_T explicitly after ensuring <stdint.h> is included? That
> would seem to be the most portable approach and I think is what the
> "Portable software should not rely on these tests" implies.
I agree. GDB now requires C++11, which always has intmax_t, so it should
be fine to simply always require this.
> target-float.c always includes <stdint.h> via "defs.h" ->
> "common/common-defs.h", so just adding the #define should be sufficient.
>
> Indeed, this does fix the build on FreeBSD:
>
> diff --git a/gdb/target-float.c b/gdb/target-float.c
> index 32237ec9d9..b40b6416c1 100644
> --- a/gdb/target-float.c
> +++ b/gdb/target-float.c
> @@ -1147,6 +1147,8 @@ host_float_ops<T>::compare (const gdb_byte *x, const
> struct type *type_x,
>
> #ifdef HAVE_LIBMPFR
>
> +#define MPFR_USE_INTMAX_T
> +
> #include <mpfr.h>
>
> class mpfr_float_ops : public target_float_ops
This looks good to me. Can you check this in?
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com
next prev parent reply other threads:[~2017-11-29 17:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-16 19:00 Ulrich Weigand
2017-11-29 0:37 ` John Baldwin
2017-11-29 17:55 ` Ulrich Weigand [this message]
2017-11-29 18:04 ` Pedro Alves
2017-11-30 0:27 ` John Baldwin
2017-12-10 15:10 ` Regression on i686 host: gdb.base/floatn.exp: " Jan Kratochvil
2017-12-10 15:13 ` Jan Kratochvil
2017-12-11 14:14 ` Ulrich Weigand
2017-12-11 14:30 ` Ulrich Weigand
2018-06-20 8:55 ` New FAIL gdb.base/float128.exp on ppc64le [Re: [RFC v2][2/2] Target FP: Make use of MPFR if available] Jan Kratochvil
2018-06-20 12:33 ` Ulrich Weigand
2018-06-20 12:50 ` Jan Kratochvil
2018-06-20 13:39 ` Ulrich Weigand
2018-06-20 13:47 ` Jan Kratochvil
2018-06-20 14:28 ` Ulrich Weigand
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=20171129175536.A27B8D80320@oc3748833570.ibm.com \
--to=uweigand@de.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=jhb@freebsd.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).