Assertion Error

This is a discussion on Assertion Error within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Somehow, I found this amusing....

  1. #1
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796

    Assertion Error

    Somehow, I found this amusing.
    My best code is written with the delete key.

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    "overblown speak-and-spell". :rofl:

    Good stuff.

  3. #3
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    Heh . My computer's waaaay too aggressive, it tries to kill me all the time. It's crazy.
    Do not make direct eye contact with me.

  4. #4
    Registered User axon's Avatar
    Join Date
    Feb 2003
    Posts
    2,572
    made me chuckle...good stuff, 8/10

    some entropy with that sink? entropysink.com

    there are two cardinal sins from which all others spring: Impatience and Laziness. - franz kafka

  5. #5
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Thanks Prelude

  6. #6
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Prelude.Reputation++;
    My Website

    "Circular logic is good because it is."

  7. #7
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    Prelude.Reputation++;
    You must spread some Reputation around before giving it to Prelude again.
    Makes me sad

  8. #8
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    Hehe.

    Wait...


    What is an assertion error, anyways?

  9. #9
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    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.
    My Website

    "Circular logic is good because it is."

  10. #10
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >What is an assertion error, anyways?
    An error found in debugging that says the code is broken. For example:
    Code:
    #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.
    My best code is written with the delete key.

  11. #11
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,263
    Quote Originally Posted by Prelude
    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...

  12. #12
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >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.
    My best code is written with the delete key.

  13. #13
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    As a former UO addict, roleplayer and geek, that site made my day. Great stuff
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  14. #14
    Rad gcn_zelda's Avatar
    Join Date
    Mar 2003
    Posts
    942
    Oh. I see.

    So there on purpose, eh? Nifty.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Getting an error with OpenGL: collect2: ld returned 1 exit status
    By Lorgon Jortle in forum C++ Programming
    Replies: 6
    Last Post: 05-08-2009, 08:18 PM
  2. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 03:09 AM
  3. how do you resolve this error?
    By -EquinoX- in forum C Programming
    Replies: 32
    Last Post: 11-05-2008, 03:35 PM
  4. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  5. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM

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