scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

0003-assert.c (321B)


      1 #include <assert.h>
      2 #include <stdio.h>
      3 
      4 /*
      5 output:
      6 First assert
      7 Second assert, that must fail
      8 end:
      9 */
     10 
     11 int
     12 main()
     13 {
     14 	int i;
     15 	char c;
     16 
     17 	printf("First assert\n");
     18 	assert(sizeof(i) >= sizeof(c));
     19 
     20 #define NDEBUG
     21 #include <assert.h>
     22 
     23 	printf("Second assert, that must fail\n");
     24 	assert(sizeof(i) < sizeof(c));
     25 
     26 	return 0;
     27 }