Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Jose on April 18, 2005, 07:48:58 PM

Title: Beware!! stack size and compiler errors (something I found with VBCC...)
Post by: Jose on April 18, 2005, 07:48:58 PM
Been fiddling with my vanilla A1200 this weekend and found that a low stack size caused an identifier expected error in VBCC. I already had the stack higher than default but it wasn't enouph. The error disappeared when I raised the stack even more!!! I know behaviour is a bit unpredictable with stack overflow but I was hoping for a crash or something else not that error. Well actually it did crash once in a while.
Title: Re: Beware!! stack size and compiler errors (something I found with VBCC...)
Post by: Dietmar on April 18, 2005, 09:04:39 PM
So what amount of stack did you use?
Title: Re: Beware!! stack size and compiler errors (something I found with VBCC...)
Post by: Thomas on April 18, 2005, 09:22:45 PM
Quote

Jose wrote:
I already had the stack higher than default but it wasn't enouph. The error disappeared when I raised the stack even more!!!



Sounds like you are a bit too cautious.

I've installed StackAttack with a minimum stack size of 40,000 for all programs. For development I usually use 100,000 bytes or more.

Be assured that VBCC needs much fewer stack than GCC for example.

Bye,
Thomas
Title: Re: Beware!! stack size and compiler errors (something I found with VBCC...)
Post by: Jose on April 18, 2005, 09:24:12 PM
@Dietmar

Mostly 10000 [edit]bytes. It was recommended on the VBCC docs for not very big projects (latest VBCC version recommends 40KB, but I was using a previous version). I got that error with a single function of around 250 lines I tried to compile separetely. Needless to say the whole program (around 50KB source) would never compile with that stack specially with 2MB chip ram only :lol:
Title: Re: Beware!! stack size and compiler errors (something I found with VBCC...)
Post by: Jose on April 18, 2005, 09:29:50 PM
@Thomas

"Sounds like you are a bit too cautious."

I had to, I was getting out of memory, so started booting without startup sequence, running a script to make the VBCC assigns and then using the commnad line to compile, to have more spare chip ram. It worked :-)