Skip to content

Instantly share code, notes, and snippets.

@lucca65
Created November 1, 2016 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucca65/7a2707a62099c83687e38a0fe473e4b6 to your computer and use it in GitHub Desktop.
Save lucca65/7a2707a62099c83687e38a0fe473e4b6 to your computer and use it in GitHub Desktop.
/*
* DO NOT COMPILE AND RUN UNLESS YOU KNOW WHAT YOU ARE DOING.
* This is a 29 byte C code that compiles to a 17,179,875,837 byte (16 GB) executable.
* Author: Digital Trauma (codegolf.stackexchange.com/users/11259/digital-trauma)
* This defines the main function as a large array and initialises its first element.
* This causes GCC to store the entire array in the resulting executable.
* Because this array is bigger than 2GB,
* we need to provide the -mcmodel=medium flag to GCC.
* The extra 15 bytes are included in the score, as per the rules.
* Compile with:
* $ gcc -mcmodel=medium cbomb.c -o cbomb
* See the original thread:
* codegolf.stackexchange.com/questions/69189/build-a-compiler-bomb/69193#69193
*/
main[-1u]={1};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment