Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: New and improved version of cdecl Date: Thu, 23 Oct 2025 19:00:29 -0700 Organization: None to speak of Lines: 56 Message-ID: <8734792h4y.fsf@example.invalid> References: <87bjlyobts.fsf@example.invalid> <10dbvqs$12d0f$1@dont-email.me> <10dd0fj$1jbcv$1@dont-email.me> <87jz0l2pal.fsf@example.invalid> <10dei5s$28h93$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Fri, 24 Oct 2025 02:00:30 +0000 (UTC) Injection-Info: dont-email.me; posting-host="69089273d8ad8cb61d3f6cd6f642af28"; logging-data="2409985"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18o/oepy1dEvmhcK2t2NBaS" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:ac/yilxgdAqRSHJI/72mWXAskbY= sha1:/PE2lIlgLfWG45g/EOrfZ+SwxA8= Xref: csiph.com comp.lang.c:394698 bart writes: > On 24/10/2025 00:04, Keith Thompson wrote: >> bart writes: [...] I note that you've ignored the vast majority of my previous article. >>> Regarding your example, my old C compiler (which is a fraction the >>> size of this new Cdecl) 'explains' it as: >>> >>> 'ref proc(int)ref proc()void' >>> >>> (Not quite English, more Algol68-ish.) >> Can I run your old C compiler on my Ubuntu system? >> > > The old one needed a tweak to bring it up-to-date for my newer C > transpiler. So it was easier to port the feature to the newer product. > > Download https://github.com/sal55/langs/blob/master/ccu.c > > (Note: 86Kloc/2MB file; this is poor quality, linear C generated from > intermediate language.) > > Build instructions are at the top. Although this targets Win64, it > works enough to demonstrate the feature above. Create this C file (say > test.c): > > int main(void) { > void (*f(int i))(void); > $showmode f; > } > > Run as follows (if built as 'ccu'): > > ./ccu -s test > > It will display the type during compilation. > > Obviously this is not a dedicated product (and doing the reverse needs > a separate program), but I only needed to add about 10 lines of code > to support '$showmode'. > > Original source, omitting the unneeded output options, would be 2/3 > the size of that configure script. OK, I was able to compile and run your ccu.c, and at least on this example it works as you've described it. It looks interesting, but I personally don't find it particularly useful, given that I already have cdecl, I prefer its syntax, and it's easier to use (and I almost literally could not care less about the number of lines of code needed to implement cdecl). -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */