Hi everybody!
Does someone know the answer to the question above? More specifically,
in the function below, if I uncomment the array declaration, I get
either garbage or no output at all. With it commented out, the
function works fine. I cannot find anything in either gcc manual or
C99 standard to indicate that vla's and variadic functions cannot mix.
An almost identical version (with putchar instead of UCA...) compiled
with gcc 4.3.2 on my Linux box works fine either way. Yes, I disabled
all the optimizations in both cases.
Thanks
void vla_variadic_test( int length, char *string, ... ) {
// char array[length];
int i;
va_list arguments;
va_start( arguments, string );
for( i = 0; i < length; i++ ) {
while( !(IFG2 & UCA0TXIFG) );
UCA0TXBUF = string[i];
}
va_end( arguments );
while( UCA0STAT & UCBUSY );
delay50usec;
}
------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and,
should the need arise, upgrade to a full multi-node Oracle RAC database
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users