Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #122881

Re: New and improved version of cdecl

From Keith Thompson <Keith.S.Thompson+u@gmail.com>
Newsgroups comp.lang.c, comp.lang.c++
Subject Re: New and improved version of cdecl
Date 2025-10-26 15:36 -0700
Organization None to speak of
Message-ID <87v7k1z3xk.fsf@example.invalid> (permalink)
References <87bjlyobts.fsf@example.invalid> <10dlrl2$78t1$1@dont-email.me>

Cross-posted to 2 groups.

Show all headers | View raw


Andrey Tarasevich <noone@noone.net> 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
<https://github.com/paul-j-lucas/cdecl/>.  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 <https://gnu.org/licenses/gpl.html>.
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 */

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

New and improved version of cdecl Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-10-22 14:39 -0700
  Re: New and improved version of cdecl Thiago Adams <thiago.adams@gmail.com> - 2025-10-22 22:19 -0300
  Re: New and improved version of cdecl Andrey Tarasevich <noone@noone.net> - 2025-10-26 12:09 -0700
    Re: New and improved version of cdecl Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-10-26 15:36 -0700
      Re: New and improved version of cdecl "Paul J. Lucas" <paul@lucasmail.org> - 2025-12-09 07:31 -0800
        Re: New and improved version of cdecl Kaz Kylheku <046-301-5902@kylheku.com> - 2025-12-09 20:38 +0000
          Re: New and improved version of cdecl "Paul J. Lucas" <paul@lucasmail.org> - 2025-12-09 16:46 -0800
            Re: New and improved version of cdecl Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-12-09 17:51 -0800
  Re: New and improved version of cdecl "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-10-26 14:44 -0700
    Re: New and improved version of cdecl Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-10-26 15:38 -0700
      Re: New and improved version of cdecl "Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> - 2025-10-27 11:51 -0700

csiph-web