>lovecreatesbeauty wrote:
>I read the following code in `Lions' Commentary on UNIX 6th Edition
with Source Code'. [missing "=" in initializer: "int i 3;" etc.]
In article <e9**********@malatesta.hpl.hp.com>,
Chris Dollin <ch**********@hp.comwrote:
>I seem to recall that once upon a time initialisers didn't need
an `=` sign. Sadly a quick google doesn't find supporting
evidence, apart from a very weak hint about a "change". Anyone
got a reference (for confimation or refutation)?
In Version 6 C, initializers did not use "=":
int i 3;
int j[] { 0, 1, 2 };
In addition, if you started a file with any character other than "#",
the preprocessor did not run; so:
/* this is a V6 C program */
#define THIS 1
would not work as desired. (For this reason, a lot of V6 C programs
started with "#" on a line by itself.)
In similar oddness, one wrote, e.g.:
printf(2, "error message\n");
to send the printf() output to stderr. There was no fprintf() (not
until the "standard I/O library" was written, at least; and you
had to ask for that with "-lS" on the link line.)
Of course, none of this is even slightly odd compared to even-earlier
C:
struct (
int a; /* holds positive and negative values */
char *b; /* holds values from 0 to 65535 */
);
Yes, those are parentheses, not braces; and to hold unsigned integers,
one used pointers. (There was no "unsigned" keyword yet.)
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it
http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.