Abnormal Program Termination when executed from C:\Program Files\...

This is a discussion on Abnormal Program Termination when executed from C:\Program Files\... within the Windows Programming forums, part of the Platform Specific Boards category; Just as a heads up, some debuggers (such as Visual Studio) will complain if you use uninitialized variables....

  1. #46
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,657
    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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,657
    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.

Page 4 of 4 FirstFirst 1234
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. List all system and program files
    By tnbui in forum Windows Programming
    Replies: 7
    Last Post: 07-10-2009, 02:43 AM
  2. Replies: 5
    Last Post: 02-11-2008, 12:36 AM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. Abnormal program termination
    By Kayoss in forum C++ Programming
    Replies: 3
    Last Post: 05-16-2006, 03:29 PM
  5. abnormal program termination
    By ProLin in forum C++ Programming
    Replies: 2
    Last Post: 01-20-2002, 08:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21