Skip to content

Instantly share code, notes, and snippets.

@eatnumber1
eatnumber1 / sls.c
Created January 14, 2013 18:49
A awesome^H^H^H^H^H^H^Hdisgusting use of the stack in C.
#include <stdio.h>
#include <setjmp.h>
#include <stddef.h>
#include <string.h>
#define NORETURN __attribute__((noreturn))
typedef void (*AllocCont)( void * );
void NORETURN longjmp_on_return( AllocCont f, jmp_buf env, void *mem ) {
@eatnumber1
eatnumber1 / resolve
Created October 11, 2011 13:17
Dynamic linking example
A hand-crafted dynamic resolver.
@eatnumber1
eatnumber1 / README
Created September 30, 2010 22:43
Object-Oriented C
Your compiler must support blocks.
To compile, run ONE of the following:
gcc -o ooc -std=c99 -fblocks ooc.c
clang -o ooc ooc.c
The output looks like this:
Integer: 1337
String: "Hello World!"