sdcc: can't make the --std-c99 option to work

Other misc things
Post Reply
nippur72
Member
Posts: 29
Joined: Sat Sep 29, 2018 4:47 pm

sdcc: can't make the --std-c99 option to work

Post by nippur72 »

I would like to declare variables in the middle of a function, not just at the top, but sdcc does not allow me to.

I tried to pass the switch -Cs--std-c99 to enable C99 standard, but it doesn't seem to work:

Code: Select all

int x()
{     
  x();  
  int z=3; 
}

zsdcc --constseg rodata_compiler   -mz80 --no-optsdcc-in-asm --c1mode --emit-externs  --no-c-code-in-asm   --verbose --std-c99  --no-peep --peep-file "C:\Programmi\z88dk\lib\config\..\..\/libsrc/_DEVELOPMENT/sdcc_peeph.3"  < "C:\Users\Nino\AppData\Local\Temp\zcc4A672.i" -o "C:\Users\Nino\AppData\Local\Temp\zcc4A672.opt"

sdcc: Generating code...
lib500.c:4: syntax error: token -> 'int' ; column 5
what I am missing?
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I think that's only available in SDCC 3.8.0 - we've not yet upgraded to that version yet.
Post Reply