Search code examples
cmacosubuntumanpagecc

`man cc`: no info about -Wall and -g flags (Learn C the Hard Way)


I am on exercise 2 of "Learn C the Hard Way. One of the extra credit challenges is:

Read man cc to find out more information on what the flags -Wall and -g do.

I am on OSX and used man cc to open the manual page but it doesn't have any info about -Wall or -g. However, I logged into a machine running Ubuntu and found a much larger manual page for cc that did include the information.

Why are the manual pages for OSX (Darwin?) and Ubuntu different? I obviously don't know anything about this stuff but I would've assumed that the manual pages would come packaged with the software and thus be the same no matter where the software was installed.


Solution

  • It's likely that your OS X installation is using a compiler named clang and your Linux installation is using a compiler named gcc.

    Therefore the man pages on OS X are probably written by the clang team and the man pages on your Linux installation are probably written by the gcc team.

    These two compilers generally accept the same command line arguments though.