public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, ming32]: Fix OUTPUT_QUOTED_STRING macro argument expansion
@ 2011-05-18 19:43 Uros Bizjak
  2011-05-20 16:07 ` Uros Bizjak
  0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2011-05-18 19:43 UTC (permalink / raw)
  To: gcc-patches; +Cc: Kai Tietz

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

Hello!

This macro compiles by pure luck.

2011-05-18  Uros Bizjak  <ubizjak@gmail.com>

	* config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
	argument expansion.

Patch was compile tested by crosscompiling to ming32 target.

OK for mainline?

Uros.

[-- Attachment #2: p.diff.txt --]
[-- Type: text/plain, Size: 1488 bytes --]

Index: mingw32.h
===================================================================
--- mingw32.h	(revision 173864)
+++ mingw32.h	(working copy)
@@ -160,11 +160,12 @@ along with GCC; see the file COPYING3.  
 #undef OUTPUT_QUOTED_STRING
 #define OUTPUT_QUOTED_STRING(FILE, STRING)               \
 do {						         \
+  const char *_string = (const char *) (STRING);	 \
   char c;					         \
 						         \
-  putc ('\"', asm_file);			         \
+  putc ('\"', (FILE));				         \
 						         \
-  while ((c = *string++) != 0)			         \
+  while ((c = *_string++) != 0)			         \
     {						         \
       if (c == '\\')				         \
 	c = '/';				         \
@@ -172,14 +173,14 @@ do {						         \
       if (ISPRINT (c))                                   \
         {                                                \
           if (c == '\"')			         \
-	    putc ('\\', asm_file);		         \
-          putc (c, asm_file);			         \
+	    putc ('\\', (FILE));		         \
+          putc (c, (FILE));			         \
         }                                                \
       else                                               \
-        fprintf (asm_file, "\\%03o", (unsigned char) c); \
+        fprintf ((FILE), "\\%03o", (unsigned char) c);	 \
     }						         \
 						         \
-  putc ('\"', asm_file);			         \
+  putc ('\"', (FILE));					 \
 } while (0)
 
 /* Define as short unsigned for compatibility with MS runtime.  */

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, ming32]: Fix OUTPUT_QUOTED_STRING macro argument expansion
  2011-05-18 19:43 [PATCH, ming32]: Fix OUTPUT_QUOTED_STRING macro argument expansion Uros Bizjak
@ 2011-05-20 16:07 ` Uros Bizjak
  2011-05-20 16:32   ` Kai Tietz
  0 siblings, 1 reply; 3+ messages in thread
From: Uros Bizjak @ 2011-05-20 16:07 UTC (permalink / raw)
  To: gcc-patches; +Cc: Kai Tietz

On Wed, May 18, 2011 at 8:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:

> 2011-05-18  Uros Bizjak  <ubizjak@gmail.com>
>
>        * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
>        argument expansion.
>
> Patch was compile tested by crosscompiling to ming32 target.

I went ahead and commit this patch to mainline SVN under obvious rule.

Uros.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, ming32]: Fix OUTPUT_QUOTED_STRING macro argument expansion
  2011-05-20 16:07 ` Uros Bizjak
@ 2011-05-20 16:32   ` Kai Tietz
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Tietz @ 2011-05-20 16:32 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: gcc-patches

2011/5/20 Uros Bizjak <ubizjak@gmail.com>:
> On Wed, May 18, 2011 at 8:36 PM, Uros Bizjak <ubizjak@gmail.com> wrote:
>
>> 2011-05-18  Uros Bizjak  <ubizjak@gmail.com>
>>
>>        * config/i386/mingw32.h (OUTPUT_QUOTED_STRING): Fix macro
>>        argument expansion.
>>
>> Patch was compile tested by crosscompiling to ming32 target.
>
> I went ahead and commit this patch to mainline SVN under obvious rule.
>
> Uros.

Sorry didn't noticed this thread. Yes, patch is ok.

Thanks,
Kai

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-20 15:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-18 19:43 [PATCH, ming32]: Fix OUTPUT_QUOTED_STRING macro argument expansion Uros Bizjak
2011-05-20 16:07 ` Uros Bizjak
2011-05-20 16:32   ` Kai Tietz

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).