qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Weil <weil@mail.berlios.de>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org, Juan Quintela <quintela@trasno.org>
Subject: [Qemu-devel] Re: [PATCHv2] configure: verify stdio.h
Date: Tue, 26 Jan 2010 22:44:44 +0100	[thread overview]
Message-ID: <4B5F624C.7060402@mail.berlios.de> (raw)
In-Reply-To: <20100126160147.GA3460@redhat.com>

Michael S. Tsirkin schrieb:
> Verify that stdio.h supports %lld %zd.
> Some migw variants don't unless requested explicitly (see

migw -> mingw

I don't know any ming32 variant which supports %lld, %zd.
There is a new mingw-w64 were people are addressing the
problem, but that variant is unsupported by qemu.


> http://www.mail-archive.com/mingw-w64-public@lists.sourceforge.net/msg00417.html)
> ), detect them early.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> Acked-by: Juan Quintela <quintela@trasno.org>
>
> ---
>
> changes from v1:
> removed leftover chunk
>
> configure | 20 ++++++++++++++++++++
> 1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/configure b/configure
> index 5631bbb..6ba06d6 100755
> --- a/configure
> +++ b/configure
> @@ -123,6 +123,26 @@ else
> exit 1
> fi
>
> +# Check that stdio.h compiler is sane: some
> +# mingw variants do not support %z %l that we rely on
> +cat > $TMPC <<EOF
> +#include <stddef.h>
> +#include <stdio.h>
> +size_t z = 1;
> +long long ll = 2;
> +int main(void) {
> + printf("z=%zd;ll=%lld;\n", z, ll);
> + return 0;
> +}
> +EOF
> +
> +if compile_prog && ($TMPE | grep "z=1;ll=2;" > /dev/null); then
> + : C compiler works ok
> +else
> + echo "ERROR: \"$cc\" does not have a working stdio.h"
> + exit 1
> +fi
> +
> check_define() {
> cat > $TMPC <<EOF
> #if !defined($1)


Tests of %lld must use a 64 bit pattern (ll = 0x0123456789abcdefLL).
Otherwise, %lld, %ld and %d with ll = 1 will all print 1 on little endian
machines, and the %lld test won't detect missing support.

The problem is now several years old, it can be avoided for really
important output, so it seems acceptable to wait another period
of time until a working mingw is supported by qemu.

A test which prevents qemu builds on windows with current mingw32
or cross builds with current debian cross mingw32 would not help.
Both variants work for me even without full format support.

Regards,
Stefan Weil

  parent reply	other threads:[~2010-01-26 21:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-26 16:01 [Qemu-devel] [PATCHv2] configure: verify stdio.h Michael S. Tsirkin
2010-01-26 18:12 ` [Qemu-devel] " Måns Rullgård
2010-01-26 19:31   ` Blue Swirl
2010-01-26 21:44 ` Stefan Weil [this message]
2010-01-27  9:13   ` Michael S. Tsirkin
2010-01-27 19:02     ` Stefan Weil
2010-01-27 19:12       ` Michael S. Tsirkin
2010-01-27 21:48         ` Måns Rullgård
2010-01-28 17:48       ` Michael S. Tsirkin

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=4B5F624C.7060402@mail.berlios.de \
    --to=weil@mail.berlios.de \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@trasno.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 NNTP newsgroup(s).