NO

Author Topic: Errors when defining compound literals  (Read 2438 times)

neo313

  • Guest
Errors when defining compound literals
« on: November 01, 2014, 10:56:52 PM »
Defining more than 10 compound literals of type in a array of pointers to that type gives an error:

error #3101: [asm] Invalid argument to 'GLOBAL'.
error #3151: [asm] Syntax error.


Variable must be declared in a function. Declaring them global works normally. Structs are not affected. Optimizations don't matter. Other settings don't matter.

Pelles:8 v6, 32bit, Win7

Code: [Select]
int main( void )
{

char* s[] = { ( char[] ){"a"} ,
( char[] ){"b"} ,
( char[] ){"c"} ,
( char[] ){"d"} ,
( char[] ){"e"} ,
( char[] ){"f"} ,
( char[] ){"g"} ,
( char[] ){"h"} ,
( char[] ){"i"} ,
( char[] ){"j"} ,
( char[] ){"k"} ,  } ;

int* i[] = { ( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0} ,
( int[] ){0}  } ;

return 0 ;
}



http://ideone.com/nHIota
« Last Edit: November 01, 2014, 11:03:22 PM by neo313 »