PDA

View Full Version : Assertion Error



Prelude
06-09-2004, 08:05 AM
Somehow, I found this (http://www.reallifecomics.com/daily.php?strip_id=1212) amusing. ;)

ober
06-09-2004, 08:34 AM
"overblown speak-and-spell". :rofl: :D :D

Good stuff. :)

Lurker
06-09-2004, 08:43 AM
Heh :) . My computer's waaaay too aggressive, it tries to kill me all the time. It's crazy.

axon
06-09-2004, 09:02 AM
made me chuckle...good stuff, 8/10

Thantos
06-09-2004, 02:27 PM
Thanks Prelude :)

DavidP
06-09-2004, 02:35 PM
Prelude.Reputation++;

Thantos
06-09-2004, 02:37 PM
Prelude.Reputation++;

You must spread some Reputation around before giving it to Prelude again.

Makes me sad :(

gcn_zelda
06-09-2004, 03:08 PM
Hehe.

Wait...


What is an assertion error, anyways?

DavidP
06-09-2004, 03:24 PM
assertion errors are, under normal circumstances, errors purposely thrown by the programmer to catch bugs in the code.

For example, if a programmer codes a function that he KNOWS should always return true, but he has a feeling it might be returning false, he could do:

assert myBooleanFunctionThatShouldReturnTrue( );

if it returns false, the assert statement will generate an assertion error and the program will stop execution.

Normally you have to turn assertions on using a command line statement or the compiler will roll right over them like they werent even there.

Prelude
06-10-2004, 07:39 AM
>What is an assertion error, anyways?
An error found in debugging that says the code is broken. For example:


#include <assert.h>

...

int
foo(
char *p
)
{
assert(p != NULL);
...
}

If foo is passed a null pointer then the calling code is wrong. Assertions should never be seen by end users. ;)

SMurf
06-10-2004, 08:56 AM
Assertions should never be seen by end users. ;)
That's odd, the amount of times I've seen them in release programs I thought they were an integral part of MS Visual C++ Runtime (MSVCRT.DLL). That and null pointer assignments.

Usually I just test specific cases and if there's a problem I just open up a message box and swear at myself. Oh well... :rolleyes:

Prelude
06-10-2004, 09:05 AM
>That's odd, the amount of times I've seen them in release programs I thought they were an integral part of MS Visual C++ Runtime (MSVCRT.DLL).
This would be funny without any additional comment, but I feel the need to bring it to everyone's attention nonetheless. :)

nvoigt
06-10-2004, 01:32 PM
As a former UO addict, roleplayer and geek, that site made my day. Great stuff :D :D :D

gcn_zelda
06-10-2004, 03:46 PM
Oh. I see.

So there on purpose, eh? Nifty.