Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Common pre-C89 compiler/stdlib idioms (1985-1988)

Tags:

c

history

I'm writing a C compiler for the fictional DCPU-16 CPU (which will be used in the 0x10C game). In this game world any original software written for the system has been developed before (or during) 1988: so I'm trying to write my compiler like it was coded between 1985-1988. I've got a copy of the C89 standard, but would like to know how common compilers preceding this differed from the standard and the common coding styles of the period.

So far this is what I'm assuming:

  • I need to use preprocessor support to define both old and new style function definitions/prototypes.
  • Coding style generally uses "something_with_an_underscore" for types, functions and variables (is this true? how prevelant was Hungarian notation during the period? what about camel case?)

Other things I would like to know:

  • How did common c compilers/stdlibs differ from the later C89 standard?
  • What common code patterns were in vogue?
  • How were common variables named at the time (i, n, foo, bar?)
  • Do you have any example code from the time?
  • Etc...
like image 409
0x0D0A Avatar asked Jan 30 '13 19:01

0x0D0A


1 Answers

When there's no defined standard, people only care about getting it "work". It's applicable to just about anything, not just C language. So it's hard tell the difference between all pre-standard coding styles/naming conventions etc against the standadized one. I'd think most would have just followed whatever there in K&R books (1st & 2nd).

For samples...

You can look at Dennis Ritchie's site where he has given some examples: Very early C compilers and language. You can search through that site for more relevant information. But I don't think you'd get answers for all your questions.

like image 59
P.P Avatar answered Sep 28 '22 01:09

P.P