Menu

Dev-C++ stack overflow problem

jefe goode
2010-06-24
2012-09-26
  • jefe goode

    jefe goode - 2010-06-24

    I am using the Bloodshed Dev-C++ compiler and am getting a stack overflow
    error.

    Does anyone know which compile /link flags i need to use in project options to
    increase the stack size?

    Thanks

    Jefe

     
  • cpns

    cpns - 2010-06-26

    The stack is a limited resource for a reason, and it is likely that you are
    using it inappropriately. Even so the amount of stack allocated to a process
    in Windows is typically 2Mb, which is considerable. Changing the stack size is
    unlikely to be an appropriate solution. If you have a stack overflow it will
    either be because your code has a bug that needs fixing, or because of ill-
    advised coding practices.

    The most likely cause is creation of large local objects or arrays. If this is
    the case you should use dynamic memory allocation or allocate the object
    statically as appropriate. As a guide, use dynamic memory allocation for
    transient objects or where the size or number of objects required is
    determined at runtime, and use static allocation where a fixed known size or
    number are required for the lifetime of the process execution, and where
    reentrancy is not an issue.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.