Welcome, Guest. Please login or register.

Author Topic: Beware!! stack size and compiler errors (something I found with VBCC...)  (Read 986 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
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.
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline Dietmar

  • Full Member
  • ***
  • Join Date: Nov 2002
  • Posts: 220
    • Show only replies by Dietmar
    • http://devplex.awardspace.biz
So what amount of stack did you use?
 

Offline Thomas

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

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
@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:
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline JoseTopic starter

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2869
    • Show only replies by Jose
@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 :-)
\\"We made Amiga, they {bleep}ed it up\\"