[TUHS] The evolution of Unix facilities and architecture

Hellwig Geisse hellwig.geisse at mni.thm.de
Sat May 13 09:25:42 AEST 2017


On Sa, 2017-05-13 at 07:12 +1000, Dave Horsfall wrote:
> 
> Let's see:
> 
>     aneurin% cdecl
>     Type `help' or `?' for help
>     explain void (*p)(int)
>     declare p as pointer to function (int) returning void
> 
> So the "fundamental" type (if there was such a thing) would be a
> pointer to a function, I guess i.e. don't treat it as anything else.
> 

Yes, of course. What I was aiming at: If you try
to declare two of these variables, neither
"void (*p,q)(int)" nor "void (*(p,q))(int)"
is allowed, so you cannot use the "fundamental
type" to declare more than one variable of this
type in a single declaration list (as you had
suggested with "char* cp1, cp2").

"void (*p)(int), (*q)(int)" in contrast is legal,
but I wouldn't call "void" the fundamental type
in these declarations. Thus my statement "list
construction (in declarations) and C declarations
don't mix well" - IMO one of the difficulties in
reading/writing C declarations, and the starting
point of this discussion.

Hellwig



More information about the TUHS mailing list