Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: typedef in old C Date: Tue, 13 Dec 2022 10:30:54 -0800 Organization: None to speak of Lines: 24 Message-ID: <877cyvtau9.fsf@nosuchdomain.example.com> References: MIME-Version: 1.0 Content-Type: text/plain Injection-Info: reader01.eternal-september.org; posting-host="3ff48156ba03619b1b817f52b89d4424"; logging-data="2710224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/mQeWKXCjlBGa+beOxa8qO" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) Cancel-Lock: sha1:8j7zopGzmthMfjd3TJnq13ZiO/s= sha1:kLvmYDZcAQ+FiVgXKmKRoVEs4OY= Xref: csiph.com comp.lang.c:168539 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). Apparently it was never documented as legal. A compiler that accepted it presumably had a bug (or perhaps an extension). (1983 was 5 years after K&R1, which apparently made it clear that it's invalid.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for XCOM Labs void Void(void) { Void(); } /* The recursive call of the void */