Skip to content

Instantly share code, notes, and snippets.

@haxpor
Created November 3, 2018 19:27
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haxpor/bb0f898db85fdd837c7e0083a3a97605 to your computer and use it in GitHub Desktop.
Save haxpor/bb0f898db85fdd837c7e0083a3a97605 to your computer and use it in GitHub Desktop.
Example of assert.c with -DNDEBUG compile flag. Try to compile with `gcc -DNDEBUG assert.c` and `gcc assert.c` to see differences.
#include <stdio.h>
#include <assert.h>
int main(int argc, char* argv[])
{
int a = 10;
assert(a != 10);
printf("end of program\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment