qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Taylor Simpson <tsimpson@quicinc.com>,
	alex.bennee@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] Modify tests to work with clang
Date: Fri, 15 Nov 2019 08:23:36 +0100	[thread overview]
Message-ID: <2853dc41-919d-f32c-e531-07fd1111d59a@redhat.com> (raw)
In-Reply-To: <1573792691-398-1-git-send-email-tsimpson@quicinc.com>

On 15/11/2019 05.38, Taylor Simpson wrote:
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>  tests/tcg/multiarch/float_helpers.c | 13 ++++++++++++-
>  tests/tcg/multiarch/linux-test.c    |  2 +-
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/tcg/multiarch/float_helpers.c b/tests/tcg/multiarch/float_helpers.c
> index 8ee7903..437247c 100644
> --- a/tests/tcg/multiarch/float_helpers.c
> +++ b/tests/tcg/multiarch/float_helpers.c
> @@ -26,6 +26,17 @@
>  
>  #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
>  
> +/*----------------------------------------------------------------------------
> +| The macro QEMU_GNUC_PREREQ tests for minimum version of the GNU C compiler.
> +| The code is a copy of SOFTFLOAT_GNUC_PREREQ, see softfloat-macros.h.
> +*----------------------------------------------------------------------------*/
> +#if defined(__GNUC__) && defined(__GNUC_MINOR__)
> +# define QEMU_GNUC_PREREQ(maj, min) \
> +         ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
> +#else
> +# define QEMU_GNUC_PREREQ(maj, min) 0
> +#endif
> +
>  /*
>   * Half Precision Numbers
>   *
> @@ -79,7 +90,7 @@ char *fmt_16(uint16_t num)
>  
>  #ifndef SNANF
>  /* Signaling NaN macros, if supported.  */
> -# if __GNUC_PREREQ(3, 3)
> +# if defined(__clang__) || QEMU_GNUC_PREREQ(3, 3)

IIRC clearly, Clang reports itself as GCC 4.2, so you certainly don't
need the defined(__clang__) here.
But additionally, we require at least GCC 4.8 to compile QEMU these days
(see the check in the configure script), so you can even remove this #if
statement completely, so that the following #defines are simply always used.

 Thomas



  parent reply	other threads:[~2019-11-15  7:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-15  4:38 [PATCH] Modify tests to work with clang Taylor Simpson
2019-11-15  5:51 ` no-reply
2019-11-15  7:23 ` Thomas Huth [this message]
2019-11-15 12:17 ` Alex Bennée
2019-11-15 14:14   ` Taylor Simpson
  -- strict thread matches above, loose matches on Subject: below --
2019-11-17 23:14 Taylor Simpson
2019-11-18  8:52 ` Thomas Huth
2019-11-18  9:17 ` Richard Henderson
2019-11-18 11:48 ` Alex Bennée

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=2853dc41-919d-f32c-e531-07fd1111d59a@redhat.com \
    --to=thuth@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=tsimpson@quicinc.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 NNTP newsgroup(s).