If C is so evil why is it so successful?

Alfred M. Szmidt ams at gnu.org
Wed Apr 12 12:26:00 CDT 2017


   It was thus said that the Great Noel Chiappa via cctalk once stated:
   >     > From: Alfred M. Szmidt
   > 
   >     > No even the following program:
   >     >   int main (void) { return 0; }
   >     > is guaranteed to work
   > 
   > I'm missing something: why not?

     Yeah, I'm having a hard time with that too.  I mean, pedantically, it
   should be:


	   #include <stdlib.h>
	   int main(void) { return EXIT_SUCCESS; }

Pedantically, it does not matter -- a return from main is equivalent
to an exit(), and exit(0) is sensibly defined, and EXIT_SUCCESS can
also be different from 0 (even though I don't think such a platform
exists).

Similiarly for EXIT_FAILURE ...


More information about the cctalk mailing list