Thread: Abnormal Program Termination when executed from C:/Program Files

  1. #46
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Just as a heads up, some debuggers (such as Visual Studio) will complain if you use uninitialized variables.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  2. #47
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    Just as a heads up, some debuggers (such as Visual Studio) will complain if you use uninitialized variables.
    Actually, the debugger just catches the crash and identifies that it happend through an uninitialized variable - this is done by filling local stack-based variables with a pattern just like I described above, and when the data is being used as a pointer/index, it is detected as a "uninitialized data" error, rather than a random "got outside valid memory".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #48
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    If you want to put it that way, sure.
    There are always several ways to catch uninitialized variables.
    Having a debugger do it for you is nice, I think.

    Oh and some compiler will warn you if you try to use an uninitialized variable. I'm guessing GCC does and I know VC++ does.
    Remember always to put your compiler warnings to maximum!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #49
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Elysia View Post
    Oh and some compiler will warn you if you try to use an uninitialized variable. I'm guessing GCC does and I know VC++ does.
    Remember always to put your compiler warnings to maximum!
    gcc does as long as you use sufficient optimization to perform flow-graph-analyzis, which I believe happens at -O2 and above.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Abnormal termination
    By juice in forum Windows Programming
    Replies: 7
    Last Post: 02-03-2012, 05:05 AM
  2. Abnormal program termination
    By Kayoss in forum C++ Programming
    Replies: 3
    Last Post: 05-16-2006, 03:29 PM
  3. abnormal program termination
    By Smiley0101 in forum C++ Programming
    Replies: 1
    Last Post: 03-02-2003, 05:04 PM
  4. **///Re: Abnormal prg termination
    By jhsurti in forum C++ Programming
    Replies: 5
    Last Post: 01-07-2003, 02:33 AM
  5. abnormal program termination
    By ProLin in forum C++ Programming
    Replies: 2
    Last Post: 01-20-2002, 09:56 PM