qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel <qemu-devel@nongnu.org>,
	Fabrice Bellard <fabrice@bellard.org>,
	Paul Brook <paul@codesourcery.com>
Subject: [Qemu-devel] [PATCH, RFC] gcc -Wundef, TCG bug
Date: Sun, 31 Aug 2008 13:39:18 +0300	[thread overview]
Message-ID: <f43fc5580808310339i1307982l393c087d9d8a55d7@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 922 bytes --]

The first patch enables gcc flag -Wundef, the second one fixes most
warnings caused by this. Nothing spectacular.

Now the third patch is more interesting. It looks like there is a real
bug in TCG, exposed by the new warnings. The following code in
tcg-opc.h depends on TARGET_LONG_BITS being defined, which is not the
case:
/* QEMU specific */
#if TARGET_LONG_BITS > TCG_TARGET_REG_BITS
DEF2(debug_insn_start, 0, 0, 2, 0)
#else
DEF2(debug_insn_start, 0, 0, 1, 0)
#endif

Moreover, adding an #include "cpu.h" to get TARGET_LONG_BITS defined,
breaks dyngen targets because the prototypes in cpu.h conflict with
the generated code.

I propose to enable the gcc flag, even though it causes these warnings
with TCG code, just to remind us about the problem. The second patch
should be safe to apply. The third one should be applied only after
the tcg-opc.h change is judged safe and dyngen targets have been
converted to TCG.

[-- Attachment #2: wundef.diff --]
[-- Type: plain/text, Size: 1221 bytes --]

[-- Attachment #3: fix_wundef.diff --]
[-- Type: plain/text, Size: 16825 bytes --]

[-- Attachment #4: fix_wundef_tcg.diff --]
[-- Type: plain/text, Size: 801 bytes --]

                 reply	other threads:[~2008-08-31 11:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=f43fc5580808310339i1307982l393c087d9d8a55d7@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=fabrice@bellard.org \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.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).