News for hackers. Stuff that matters.
Re:How can C Programs be so Reliable? by mdakin on Tuesday November 11, 2008 @09:44PM (#361304)
This is why assert exists.

tyger(~)% cat << EOF > main.c

? #include <assert.h>

?

? void main( void )

? {

? assert( 0 == 1 ) ;

? }

? EOF

tyger(~)% gcc main.c

main.c: In function ‘main’:

main.c:4: warning: return type of ‘main’ is not ‘int’

tyger(~)% ./a.out

Assertion failed: (0 == 1), function main, file main.c, line 5.

Abort

tyger(~)%

There are no comments on this comment yet.