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

I am writing a C compiler for a fictional DCPU-16 processor (which will be used in a 0x10C game). In this game world, some original software was written that was written for the system before (or during) 1988: so I try to write my compiler as if it were encoded between 1985-1988. I have a copy of the C89 standard, but I would like to know how common compilers precede this, differ from the standard and general coding styles of this period.

So far this is what I am assuming:

  • I need to use preprocessor support to define definitions / prototypes of old and new style functions.
  • The coding style usually uses "something_with_an_underscore" for types, functions, and variables (is that true? How was prevelant a Hungarian designation for a period?) What about the camel case?)

Other things I would like to know:

  • How do generic c / stdlibs compilers differ from the later C89 standard?
  • What common code templates were in fashion?
  • What were the common variables called at that time (i, n, foo, bar?)
  • Do you have an example code from the point in time?
  • Etc ...
+6
source share
5 answers

, , "". , C. / .. . , , K & R (1- 2-).

...

Dennis Ritchie, : C. . , .

+2

C89, , , , .

C . ANSI C C89 , . , pre-C89, , C89.

C89:

" , : [...] . , , . , ".

0
0

, , "" , , !

,

#define foo bar
char *s = "That would be a foolish thing to do!";

char *s = "That would be a barlish thing to do!";
0

ANSI X3J11, , 1983 , 1985 . . , "[ C] , X3J11 19 85- 1986 ". [1]

[85- '86, Lattice C [2] Microsoft C 4.0 [3], , ANSI C89. const volatile ( Microsoft C ) "K & R" -style.

, 1988 ANSI C89 , - , ,

[1] http://www.catb.org/~esr/writings/taoup/html/c_evolution.html

[2] https://archive.org/details/Lattice_C_AmigaDOS_Compiler_Version_3_Programmers_Reference_Guide_1986-09-12_Lattice_Inc .

[3] http://www.os2museum.com/wp/dos/dos-library/

0
source

All Articles