Thread overview
slightly moronic gdc error: string template parameters plus unittest == endless glee
Apr 04, 2007
Downs
Apr 05, 2007
Downs
Apr 05, 2007
Downs
April 04, 2007
I have the following line somewhere in my source.
class database(RECORD) {
  //RECORD[] list;
  record!("name", char[])[] list;
}

Now, if I switch unittests on, gdc (0.23, MinGW 4.1.2) emits the following code:
	.stabs	"record!("name",char[]) []:Tt(1,30)=s8length:(1,7),0,32;ptr:(1,31)=*(1,32)=xsrecord:,32,32;;",128,0,55,0
Note the "outer" '"'s and the "inner" '"'s.
Unsurprisingly, the assembler barfs on this.
 -- still laughing, downs
April 05, 2007
I wrote:
> I have the following line somewhere in my source.
> class database(RECORD) {
>   //RECORD[] list;
>   record!("name", char[])[] list;
> }
> 
> Now, if I switch unittests on

Also seems to happen in debug mode. Basically, anything that makes gdc emit the stabs entry.
> , gdc (0.23, MinGW 4.1.2) emits the following code:
>     .stabs    "record!("name",char[]) []:Tt(1,30)=s8length:(1,7),0,32;ptr:(1,31)=*(1,32)=xsrecord:,32,32;;",128,0,55,0 
> 
> Note the "outer" '"'s and the "inner" '"'s.
> Unsurprisingly, the assembler barfs on this.
>  -- still laughing, downs
April 05, 2007
I wrote:
> I have the following line somewhere in my source.
> class database(RECORD) {
>   //RECORD[] list;
>   record!("name", char[])[] list;
> }
> 
> Now, if I switch unittests on, gdc (0.23, MinGW 4.1.2) emits the following code:
>     .stabs    "record!("name",char[]) []:Tt(1,30)=s8length:(1,7),0,32;ptr:(1,31)=*(1,32)=xsrecord:,32,32;;",128,0,55,0 
> 
> Note the "outer" '"'s and the "inner" '"'s.
> Unsurprisingly, the assembler barfs on this.
>  -- still laughing, downs

Manually escaping the inside ""s in the .s file (.stabs	"record!(\"name\" ... ") seems to make it work; maybe we should do that.