Hacker News new | past | comments | ask | show | jobs | submit login

It compiles and runs with gcc -std=c89 and gcc -std=c99, so even if it's not a true C89 program, it's a compilable GNUC89 program.

  $ gcc -std=c99 -pedantic /tmp/main.c -o /tmp/main
  /tmp/main.c:1:1: warning: data definition has no type
      or storage class [enabled by default]
  /tmp/main.c:1:1: warning: type defaults to ‘int’ in
      declaration of ‘main’ [enabled by default]
  /tmp/main.c:1:1: warning: ‘main’ is usually a function
      [-Wmain]
  
  $ /tmp/main
  Segmentation fault (core dumped)



Not on mac: a.c -> main;

    gcc -nostdlib -std=c89 a.c -o a

    a.c:1: warning: data definition has no type or storage class
    Undefined symbols for architecture x86_64:
         "start", referenced from:
         -u command line option
    ld: symbol(s) not found for architecture x86_64
    collect2: ld returned 1 exit status`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: