This is cross-posted to comp.lang.c and comp.lang.c++.
Consider redirecting followups as appropriate.
cdecl, along with c++decl, is a tool that translates C or C++
declaration syntax into English, and vice versa. For example :
$ cdecl
Type `help' or `?' for help
cdecl> explain const char *foo[42]
declare foo as array 42 of pointer to const char
cdecl> declare bar as pointer to function (void) returning int
int (*bar)(void )
It's also available via the web site <https://cdecl.org/>.
...
This is cross-posted to comp.lang.c and comp.lang.c++.I must be doing something wrong:
Consider redirecting followups as appropriate.
cdecl, along with c++decl, is a tool that translates C or C++
declaration syntax into English, and vice versa. For example :
$ cdecl
Type `help' or `?' for help
cdecl> explain const char *foo[42]
declare foo as array 42 of pointer to const char
cdecl> declare bar as pointer to function (void) returning int
int (*bar)(void )
It's also available via the web site <https://cdecl.org/>.
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.
On 10/22/2025 2:39 PM, Keith Thompson wrote:
This is cross-posted to comp.lang.c and comp.lang.c++.I must be doing something wrong:
Consider redirecting followups as appropriate.
cdecl, along with c++decl, is a tool that translates C or C++
declaration syntax into English, and vice versa. For example :
$ cdecl
Type `help' or `?' for help
cdecl> explain const char *foo[42]
declare foo as array 42 of pointer to const char
cdecl> declare bar as pointer to function (void) returning int
int (*bar)(void )
It's also available via the web site <https://cdecl.org/>.
int (*fp_read) (void* const, void*, size_t)
is syntax error. It from one of my older experiments:
"Chris M. Thomasson" <chris.m.thomasson.1@gmail.com> writes:
On 10/22/2025 2:39 PM, Keith Thompson wrote:
This is cross-posted to comp.lang.c and comp.lang.c++.I must be doing something wrong:
Consider redirecting followups as appropriate.
cdecl, along with c++decl, is a tool that translates C or C++
declaration syntax into English, and vice versa. For example :
$ cdecl
Type `help' or `?' for help
cdecl> explain const char *foo[42]
declare foo as array 42 of pointer to const char
cdecl> declare bar as pointer to function (void) returning int
int (*bar)(void )
It's also available via the web site <https://cdecl.org/>.
Yes.
int (*fp_read) (void* const, void*, size_t)
is syntax error. It from one of my older experiments:
You're using the old 2.5 version. The newer forked version handles that declaration correctly, but you have to build it from source. cdecl.org
uses the old version.
(I'm not entirely pleased that the newer version expands "char" to "character" and, worse, "int" to "integer", but I can live with it.)
On 10/26/25 3:36 PM, Keith Thompson wrote:
(I'm not entirely pleased that the newer version expands "char" to
"character" and, worse, "int" to "integer", but I can live with it.)
Hence the --no-english-types or -T command line option or the
"set noenglish" command (from within cdecl or a config file).
The thought was that those newer to C and less familiar with its
types might benefit from more elaborate output.
On 2025-12-09, Paul J. Lucas <paul@lucasmail.org> wrote:
On 10/26/25 3:36 PM, Keith Thompson wrote:
(I'm not entirely pleased that the newer version expands "char" to
"character" and, worse, "int" to "integer", but I can live with it.)
Hence the --no-english-types or -T command line option or the
"set noenglish" command (from within cdecl or a config file).
The problem is that the English words chosen already have a meaning.
"Integer" is a type category in C;
The thought was that those newer to C and less familiar with its
types might benefit from more elaborate output.
This kind of thing just ensures that newbies go sideways from being
less familiar to being incorrectly familiar.
On 12/9/25 12:38 PM, Kaz Kylheku wrote:
On 2025-12-09, Paul J. Lucas <paul@lucasmail.org> wrote:
On 10/26/25 3:36 PM, Keith Thompson wrote:The problem is that the English words chosen already have a
(I'm not entirely pleased that the newer version expands
"char" to "character" and, worse, "int" to "integer", but I
can live with it.)
Hence the --no-english-types or -T command line option or the
"set noenglish" command (from within cdecl or a config file).
meaning. "Integer" is a type category in C;
It's not a keyword, so that's irrelevant. Likewise,
"Character."
The thought was that those newer to C and less familiar withThis kind of thing just ensures that newbies go sideways from
its types might benefit from more elaborate output.
being less familiar to being incorrectly familiar.
Opinion noted. I disagree.
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 54 |
| Nodes: | 6 (1 / 5) |
| Uptime: | 20:58:33 |
| Calls: | 742 |
| Files: | 1,218 |
| D/L today: |
6 files (8,794K bytes) |
| Messages: | 185,811 |
| Posted today: | 1 |