6

I know that the most recent versions of POSIX specify that a C99-compliant compiler should (optionally) be present and called c99. Similarly, older versions of POSIX used to specify an optional c89 command to exist as part of the "C-Language Development Utilities".

However, I'm having a hard time finding any reference to cc. Is this command mentioned somewhere in the POSIX standard or just a convention?

1
  • It's leftover from the original C compilers and reluctance to use c89 when the two (cc/c89) were considered to be the same thing. Finding an authoritative source for that will be hard, since the POSIX documentation eliminates most of the historical information. Jul 16, 2017 at 20:29

1 Answer 1

5

The original POSIX 1003.1 (published in 1988) specified a cc utility. The Single Unix Specification version 2 (1997) included both cc and c89. The name c89 was introduced to be a standard dialect of C. The name cc was kept but marked as legacy and declared to be an unspecified dialect of C. Many vendors shipped a compiler that defaulted to K&R C (i.e. pre-ANSI C) under the name cc. You might note that cc is mandatory while c89 is part of the C language development option. It was common to have a C compiler under the name cc that was only really capable of compiling kernel drivers, and commercial unices often charged extra for a proper C compiler.

POSIX 1003.1-2001 (Single Unix v3) specifies c99 specifies instead of c89, to use an updated standard dialect of C. You can see some editorial traces left from a draft that included a cc utility as well, but cc was removed from the specification. POSIX 1003.1-2008 (Single Unix v4) again just has c99

3
  • 1
    So, if I understand correctly, by removing cc they made a C compiler optional as part of the "C-Language Development Utilities" instead of required? Jul 28, 2017 at 14:53
  • That's a very good and well-researched answer! I wonder why later versions of POSIX didn't specify c11 or c17 - they all seem to have stuck with c99.
    – AJM
    Jun 24, 2021 at 15:37
  • (And those "editorial traces" were causing me quite a bit of confusion - thanks for clearing it up.)
    – AJM
    Jun 24, 2021 at 15:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .