Patchwork Commit: Fix i386 ASM_OUTPUT_ASCII macro for C++ compilation.

login
register
mail settings
Submitter Nick Clifton
Date Aug. 16, 2012, 10:34 a.m.
Message ID <87zk5vqg5h.fsf@redhat.com>
Download mbox | patch
Permalink /patch/177947/
State New
Headers show

Comments

Nick Clifton - Aug. 16, 2012, 10:34 a.m.
Hi Richard, Hi Jan, Hi Uros,

  I am applying the patch below as an obvious fix for this problem when
  building an i386-elf targeted toolchain:

    gcc/dwarf2asm.c: In function 'void dw2_asm_output_nstring(const char*, size_t, const char*, ...)':
    gcc/dwarf2asm.c:334:7: error: invalid conversion from 'const unsigned char*' to 'const char*' [-fpermissive]

  With the patch applied the compiler now builds correctly.

Cheers
  Nick

gcc/ChangeLog
2012-08-16  Nick Clifton  <nickc@redhat.com>

	* config/i386/i386elf.h (ASM_OUTPUT_ASCII): Cast _ascii_bytes
	before passing it to ASM_OUTPUT_LIMITED_STRING.

Patch

Index: gcc/config/i386/i386elf.h
===================================================================
--- gcc/config/i386/i386elf.h	(revision 190438)
+++ gcc/config/i386/i386elf.h	(working copy)
@@ -73,7 +73,7 @@ 
 		  fputc ('\n', (FILE));					\
 		  bytes_in_chunk = 0;					\
 		}							\
-	      ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes);		\
+	      ASM_OUTPUT_LIMITED_STRING ((FILE), (const char *) _ascii_bytes); \
 	      _ascii_bytes = p;						\
 	    }								\
 	  else								\