←back to thread

517 points petercooper | 5 comments | | HN request time: 0.695s | source
1. methyl ◴[] No.8559044[source]
Unfortunately, I cannot compile it on my OSX 10.10... here's what I get: http://pastebin.com/cVvaYFEH

EDIT: just make next() function void and it works.

EDIT2: still no fortune :(

  $ ./c4 hello.c
  [1]    33920 segmentation fault  ./c4 hello.c
replies(3): >>8559152 #>>8559238 #>>8559277 #
2. cremno ◴[] No.8559152[source]
I think it doesn't work on x86-64, since the code assumes

    sizeof(int) == sizeof(void*)
replies(1): >>8559171 #
3. jparishy ◴[] No.8559171[source]
Yep, you can compile it on 64 bit OS X with clang's -m32 option and it should work:

    ➜  c4 git:(master) ✗ clang -m32 c4.c
    ...
    ➜  c4 git:(master) ✗ ./a.out hello.c 
    hello, world
    exit(0) cycle = 9
4. kschults ◴[] No.8559238[source]
For now, you need to add both -Wno-return-type and -m32 when compiling.
5. ackalker ◴[] No.8559277[source]
Please try kbrock's fork at https://github.com/kbrock/c4 Check out his 'longs' branch.