Path: csiph.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: New and improved version of cdecl Date: Sun, 26 Oct 2025 15:36:07 -0700 Organization: None to speak of Lines: 40 Message-ID: <87v7k1z3xk.fsf@example.invalid> References: <87bjlyobts.fsf@example.invalid> <10dlrl2$78t1$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain Injection-Date: Sun, 26 Oct 2025 22:36:11 +0000 (UTC) Injection-Info: dont-email.me; posting-host="26517a9ddea773fd455ba7963423596a"; logging-data="334038"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ezBEBMDzxtdH00LjbSJxN" User-Agent: Gnus/5.13 (Gnus v5.13) Cancel-Lock: sha1:+7J77ToTBOPvASPsajea5N3qRuk= sha1:JxfbFcyRdMq7re8fuikUtKvSNWM= Xref: csiph.com comp.lang.c:394752 comp.lang.c++:122881 Andrey Tarasevich writes: > On Wed 10/22/2025 2:39 PM, Keith Thompson wrote: >> ... > > I believe I have already posted about it here... or maybe not? > > cdecl.org reports a "syntax error" for declarations with top-level > `const` qualifiers on function parameters: > > void foo(char *const) > > Such declarations are perfectly valid. (And adding an explcit > parameter name does not help). > > The current version of cdecl.org still complains about it. You're probably using 2.5, the version most commonly packaged with Linux distributions. The cdecl.org site uses that same old version. This entire thread is about the newer version available at . It doesn't have that bug. $ cdecl --version cdecl 18.6 Copyright (C) 2025 Paul J. Lucas License GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY to the extent permitted by law. $ cdecl explain 'void foo(char *const)' declare foo as function (constant pointer to character) returning void $ cdecl explain 'void foo(char *const foo)' declare foo as function (foo as constant pointer to character) returning void $ (I'm not entirely pleased that the newer version expands "char" to "character" and, worse, "int" to "integer", but I can live with it.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com void Void(void) { Void(); } /* The recursive call of the void */