[prev] 36 [next]

Compiling with gcc (cont)

Command line options:
  • The default with gcc is not to give you any warnings about potential problems
  • Good practice is to be tough on yourself:

    prompt$ gcc -Wall prog.c
    

    which reports all warnings to anything it finds that is potentially wrong or non ANSI compliant

  • The -o option tells gcc to place the compiled object in the named file rather than a.out

    prompt$ gcc -o prog prog.c