Re: Test Your C Skills - Errors
- From: roberson@xxxxxxxxxxxxxxxxxx (Walter Roberson)
- Date: Thu, 19 Apr 2007 21:44:42 +0000 (UTC)
In article <1177014398.161636.244780@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
quarkLore <agarwal.prateek@xxxxxxxxx> wrote:
Undefined behavior
doesnt mean that it will give unpredictable behavior or your PC will
go berzerk but behavior will depend on the compiler and platform
I believe you are referring to unspecified behaviour, not
undefined behaviour. Undefined behaviour is a license for
anything to happen, including the possibility that the program
will appear to work perfectly the first 50 times, but will accidently
trigger an electric shock to your company president the first time
he or she runs the program.
This may sound rediculous, but it could be, for example, that
your president happens to be the only user with a particular
letter at a particular offset in their username, and that that
location is getting interpreted as an instruction, with
that particular character happening upon the only CPU
instruction that locks up the CPU, shorting out the databus
that then cascades to other hardware failures.
--
"It is important to remember that when it comes to law, computers
never make copies, only human beings make copies. Computers are given
commands, not permission. Only people can be given permission."
-- Brad Templeton
.
- Follow-Ups:
- Re: Test Your C Skills - Errors
- From: Kenneth Brody
- Re: Test Your C Skills - Errors
- References:
- Test Your C Skills - Errors
- From: Sharath
- Re: Test Your C Skills - Errors
- From: quarkLore
- Test Your C Skills - Errors
- Prev by Date: Re: extern and function prototypes
- Next by Date: Re: 32 or 64 bit processor info in C
- Previous by thread: Re: Test Your C Skills - Errors
- Next by thread: Re: Test Your C Skills - Errors
- Index(es):
Relevant Pages
|