Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » MSPGCC
  • » [Mspgcc-users] Do VLAs conflict with variadic functions in mspgcc v 3.2.3 ? [RSS Feed]

#1 Dec. 25, 2010 02:15:45

Alex S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[Mspgcc-users] Do VLAs conflict with variadic functions in mspgcc v 3.2.3 ?


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;
int i;

va_list arguments;
va_start( arguments, string );

for( i = 0; i < length; i++ ) {

while( !(IFG2 & UCA0TXIFG) );
UCA0TXBUF = string;

}

va_end( arguments );

while( UCA0STAT & UCBUSY );
delay50usec;

}


Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/mspgcc-users

Offline

  • Root
  • » MSPGCC
  • » [Mspgcc-users] Do VLAs conflict with variadic functions in mspgcc v 3.2.3 ? [RSS Feed]

Board footer

Moderator control

Enjoy the 23rd of October
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support