public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Marcelo Tosatti <mtosatti@redhat.com>
Subject: [PATCH kvm-unit-tests] x86: fix build (macro R interpreted as raw string)
Date: Fri, 13 Mar 2015 17:48:04 +0100	[thread overview]
Message-ID: <1426265284-29107-1-git-send-email-rkrcmar@redhat.com> (raw)

GCC 5.0.0 enables raw strings by default and they have higher priority
than macros, thus R"[...]" is interpreted incorrectly:

  lib/x86/isr.c:112:30: error: invalid character ')' in raw string delimiter
  lib/x86/isr.c:112:8: error: stray ‘R’ in program
  lib/x86/isr.c:112:26: error: expected ‘:’ or ‘)’ before string constant
          "orl $0x200, (%%"R"sp)\n\t"

Fix it by putting a space between macro R and a string literal.
(We already do that somewhere.)

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
 I think it would be better to replace
   "[...]"R "ax [...]"
 with
   "[...]" ASM_AX "[...]"

 lib/x86/desc.c | 16 ++++++++--------
 lib/x86/isr.c  |  2 +-
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/lib/x86/desc.c b/lib/x86/desc.c
index 7fbe77455430..32377780c86b 100644
--- a/lib/x86/desc.c
+++ b/lib/x86/desc.c
@@ -114,22 +114,22 @@ asm (".pushsection .text \n\t"
      "push %r15; push %r14; push %r13; push %r12 \n\t"
      "push %r11; push %r10; push %r9; push %r8 \n\t"
 #endif
-     "push %"R"di; push %"R"si; push %"R"bp; sub $"S", %"R"sp \n\t"
-     "push %"R"bx; push %"R"dx; push %"R"cx; push %"R"ax \n\t"
+     "push %"R "di; push %"R "si; push %"R "bp; sub $"S", %"R "sp \n\t"
+     "push %"R "bx; push %"R "dx; push %"R "cx; push %"R "ax \n\t"
 #ifdef __x86_64__
-     "mov %"R"sp, %"R"di \n\t"
+     "mov %"R "sp, %"R "di \n\t"
 #else
-     "mov %"R"sp, %"R"ax \n\t"
+     "mov %"R "sp, %"R "ax \n\t"
 #endif
      "call do_handle_exception \n\t"
-     "pop %"R"ax; pop %"R"cx; pop %"R"dx; pop %"R"bx \n\t"
-     "add $"S", %"R"sp; pop %"R"bp; pop %"R"si; pop %"R"di \n\t"
+     "pop %"R "ax; pop %"R "cx; pop %"R "dx; pop %"R "bx \n\t"
+     "add $"S", %"R "sp; pop %"R "bp; pop %"R "si; pop %"R "di \n\t"
 #ifdef __x86_64__
      "pop %r8; pop %r9; pop %r10; pop %r11 \n\t"
      "pop %r12; pop %r13; pop %r14; pop %r15 \n\t"
 #endif
-     "add $"S", %"R"sp \n\t"
-     "add $"S", %"R"sp \n\t"
+     "add $"S", %"R "sp \n\t"
+     "add $"S", %"R "sp \n\t"
      "iret"W" \n\t"
      ".popsection");
 
diff --git a/lib/x86/isr.c b/lib/x86/isr.c
index 833564ad5862..9b1d5054801e 100644
--- a/lib/x86/isr.c
+++ b/lib/x86/isr.c
@@ -109,7 +109,7 @@ void handle_external_interrupt(int vector)
 		     "push %[sp]\n\t"
 #endif
 		     "pushf\n\t"
-		     "orl $0x200, (%%"R"sp)\n\t"
+		     "orl $0x200, (%%"R "sp)\n\t"
 		     "push $%c[cs]\n\t"
 		     "call *%[entry]\n\t"
 		     :
-- 
2.3.2


             reply	other threads:[~2015-03-13 16:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 16:48 Radim Krčmář [this message]
2015-03-18 22:53 ` [PATCH kvm-unit-tests] x86: fix build (macro R interpreted as raw string) Marcelo Tosatti

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=1426265284-29107-1-git-send-email-rkrcmar@redhat.com \
    --to=rkrcmar@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=pbonzini@redhat.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