Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: typedef in old C
Date: Sun, 18 Dec 2022 17:25:57 -0800
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <86sfhc18wq.fsf@linuxsc.com>
References: <874jtz2r5s.fsf@bsb.me.uk>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="ff406b04d09b824d6c1109f51ef0323b"; logging-data="102999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/iabr253NLAyDsJw/oS848rLdNOOKTC58="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:dTCp0JSIn+PGY6RNunPHgk6cUtU= sha1:nX1o95OHgWux8kNVakpLC+mvlSs=
Xref: csiph.com comp.lang.c:168590
Ben Bacarisse writes:
> Bart writes:
>
>> I was looking at the 1983 C sources of PostScript (via
>> https://computerhistory.org/blog/postscript-a-digital-printing-press/).
>>
>> It uses typedef like this:
>>
>> typedef long int integer;
>> typedef unsigned integer Offset;
>>
>> That is, being able to apply 'unsigned' to a typedef-ed name, rather
>> than any of 'char short int long'.
>>
>> I guess this is not legal C now; I just wondered at what point it
>> stopped being legal, if it ever was (perhaps compilers were just more
>> lax).
>
> I doubt it has ever been legal. Even K&R1 has the wording that rules it
> out. Pre-K&R1 C might have been more lax, but for most of the time
> before K&R1 C did not even have unsigned!
>
> I wonder what else this generous compiler permitted. Could one do
>
> typedef double number;
> typedef long number hi_prec_num;
>
> for example? I doubt it.
Most likely the issue is not the compiler but the code. This
body of code has all sorts of problems, including syntax errors
and some things that are obviously wrong or incomplete. If you
try compiling it I think you'll see what I mean.
Incidentally, there are pretty clear signs of a Mesa influence,
which isn't surprising since the principals came from Xerox PARC.