Portable C Compiler | |
Author: | Stephen C. Johnson |
Developer: | AT&T Bell Laboratories |
Latest Release Version: | 1.1.0 |
Operating System: | Unix and Unix-like |
Programming Language: | C |
Genre: | C Compiler |
License: | BSD License |
The Portable C Compiler (also known as pcc or sometimes pccm - portable C compiler machine) is an early compiler for the C programming language written by Stephen C. Johnson of Bell Labs in the mid-1970s,[1] based in part on ideas proposed by Alan Snyder in 1973,[2] [3] and "distributed as the C compiler by Bell Labs... with the blessing of Dennis Ritchie."
Being one of the first compilers that could easily be adapted to output code for different computer architectures, the compiler had a long life span. It debuted in Seventh Edition Unix and shipped with BSD Unix until the release of 4.4BSD in 1994, when it was replaced by the GNU C Compiler. It was very influential in its day, so much so that at the beginning of the 1980s, the majority of C compilers were based on it.[4] Anders Magnusson and Peter A Jonsson restarted development of pcc in 2007, rewriting it extensively to support the C99 standard.[5]
Key features of pcc are its portability and improved diagnostic capabilities. The compiler was designed so that only a few of its source files are machine-dependent. It is relatively robust to syntax errors and performs more thorough validity checks than its contemporaries.
The first C compiler, written by Dennis Ritchie, used a recursive descent parser, incorporated specific knowledge about the PDP-11, and relied on an optional machine-specific optimizer to improve the assembly language code it generated. In contrast, Johnson's pccm was based on a yacc-generated parser and used a more general target machine model. Both compilers produced target-specific assembly language code which they then assembled to produce linkable object modules.
Later versions of PCC, known within Bell Labs as "QCC" and "RCC," supported other target architecture models.
The language that PCC implements is an extended version of K&R C that Bjarne Stroustrup has called "Classic C", incorporating the void
return type (for functions that don't return any value), enumerations and structure assignment.[6]
A new version of pcc, based on the original by Steve Johnson, is maintained by Anders Magnusson.[5] The compiler is provided under the BSD licence and its development is funded by a non-profit organization called BSD Fund. According to Magnusson:
This new version was added to the NetBSD pkgsrc and OpenBSD source trees in September 2007,[7] and later into the main NetBSD source tree.[8] There had been some speculation that it might eventually be used to supplant the GNU C Compiler on BSD-based operating systems,[9] though FreeBSD[10] [11] and NetBSD[12] are both looking to Clang as a potential replacement, and Theo de Raadt of OpenBSD asserts that pcc is not ready yet to be a gcc replacement, and the disposal of gcc is not top priority.[13] On December 29, 2009, pcc became capable of building a functional x86 OpenBSD kernel image.[14]
pcc version 1.0 was released on 1 April 2011.[15] As of this release, the compiler supports x86 and x86-64 processor architectures and runs on NetBSD, OpenBSD, FreeBSD, various Linux distributions, and Microsoft Windows.[16] Further development, including support for more architectures, and FORTRAN 77 and C++ front ends, is continuing as of 2022.
PCC was removed from the OpenBSD source tree in 2012.[17] Development on it had stalled and no maintainer had stepped up to develop it into something that could make a practical alternative to GNU Compiler Collection.[18] [19]
The latest version of pcc, namely 1.1.0, was released on 10 December 2014.[20]