Created
November 1, 2016 20:27
-
-
Save lucca65/7a2707a62099c83687e38a0fe473e4b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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