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. Commented 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

5
  • 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? Commented 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. Commented Jun 24, 2021 at 15:37
  • (And those "editorial traces" were causing me quite a bit of confusion - thanks for clearing it up.) Commented Jun 24, 2021 at 15:37
  • 1
    @AJM POSIX 1003.1-2024 now specifies a c17 command. Moreover, it also specifies how to create shared objects with this command. Commented Aug 29, 2024 at 5:42
  • Include a link here for reference: c17 utility of POSIX.1-2024 standard Commented Nov 9, 2024 at 17:48

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.