From: SourceForge.net <no...@so...> - 2012-07-04 06:21:43
|
Bugs item #3540054, was opened at 2012-07-03 23:21 Message generated for change (Tracker Item Submitted) made by You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3540054&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: C-Front End Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: Nobody/Anonymous (nobody) Summary: Compiler error with string initializer constants Initial Comment: Found this today... The following code emits a strange error message void foo(void) { static char x[] = {"Hello, World!\n"}; } Compiler emits error as follows: -:0: error 47: indirections to different types assignment from type 'const-char [15d] code' to type 'char auto' It appears that an invalid line number is generated. Also, this code should not be a problem. gcc has no problem with it. I simply want to initialize a character array using a string constant contained within curly braces. I downloaded the most recent SDCC tarball from SorceForge this evening and built it on my Ubuntu 12.04 64-bit system. Here is the compiler version string: SDCC : mcs51/gbz80/z80/z180/r2k/r3ka/ds390/pic16/pic14/TININative/ds400/hc08/s08 3.2.0 #7999 (Jul 4 2012) (Linux) -Pete peter UNDERSCORE arnt AT yahoo DOT com ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=3540054&group_id=599 |