O'Reilly logo

Practical C Programming, 3rd Edition by Steve Oualline

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 19. Ancient Compilers

Almost in every kingdom the most ancient families have been at first princes’ bastards....

Robert Burton

C has evolved over the years. In the beginning, it was something thrown together by a couple of hackers (Brian Kernigham and Dennis Ritchie) so that they could use a computer in the basement. Later the C compiler was refined and released as the “Portable C Compiler.” The major advantage of this compiler was that you could port it from machine to machine. All you had to do was write a device configuration. True, writing one was extremely difficult, but the task was a lot easier than writing a compiler from scratch.

The Portable C Compiler was widely distributed and soon became the most widely used C compiler around. Because there were no official standards around at the time, whatever the Portable C Compiler could compile became the “official” standard.

This chapter describes that “standard.” The Portable C Compiler didn’t have many of the features that were later defined in the ANSI standard. Many of these new features were added to make C programs safer and more reliable. Programming in ANSI C is difficult enough. Programing in the old Portable C is like walking a tightrope with no net—blindfolded.

K&R-Style Functions

K&R-style C compilers use an older style of declaring functions. For example, the ANSI C function declaration:

int process(int size, float data[], char *how)

in K&R C would be:

int process(size, data, how) int size; float data[ ]; char *how; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required