Re: Mangled function prototypes (phantom arguments)

Alejandro Colomar <[email protected]> Wed, 27 May 2026 19:58:28 +0200
Newsgroups org.kernel.vger.linux-man
Message-ID <ahcvtYzeadqmhk62@devuan>
Hi Michael,

On 2026-05-27T18:46:06+0200, Michael Kerrisk (man7.org) wrote:
> Hello Alex,
> 
> Thanks for responding.
> 
> > > The problems have all resulted in prototypes adding a phantom first
> > > argument. See for example this prototype from read.2:
> > >
> > >        ssize_t read(size_t count;
> > >                     int fd, void buf[count], size_t count);
> >
> > This is valid C (except for the array of void, but that's a separate
> > topic).
> 
> As we see, I'm not keeping up with my C :-).

To be fair, this is a very little-known feature (even though it's a very
old one).  I (and a few others) are trying to make it more well known,
as it's quite interesting.

> 
> Is this a GNU extension? Or part of the standard? Or an upcoming part
> of the standard?

It is a very old GNU extension.  For decades, almost nobody had been
interested in it (I've never seen it used in the wild).  One or two
years ago, we started discussing it in the C Committee; several of us
want it to be standard.  However, Clang is vetoing it.


Cheers,
Alex

> 
> Thanks,
> 
> Michael

-- 
<https://www.alejandro-colomar.es>
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmoXML8ACgkQ64mZXMKQ
wqlVfBAAvq2LRhaAYWmXaYmM8jaZYPqZbQ971GEmHxOYzpQ+nTF1npmekg00G92X
PsXIQNA8Fbpb2gMe9euukL7AcDaSK55pr8Ku8sC3dTykIRiUSfBSW35dPzYVuyBd
vkB/x+Op00wyOOs3D0irIIIcKpam2JAEZooU4fdSgmSOMl7J3aZha0IbMRLUofuz
4jtaH1YwFgWPjFa/sQ1txmZp9JZ4Vhs7+7EJR3Z1p7q4yK6FvhPVgswr5kMtzmaP
Ii5T9oiaNEaFmTwladCa/AvY6IHBHxIOSjKMaljpVnxEagcGpMdNhtgpoIr4pMMA
hNSnrPgEQnsAJ+0bKxHQTRamfKegUtc9w/lAF81BaB/nHnIBpZPRF1US1Zk+Po+v
bzZoP2aq72Wgu1vr74PKAm8IYNly/FNW808Wo8L59mgGO36ORjKeQTMKCSIYABxK
lWq+avodxd8x2LoSiumtuSmDE4omNO/gJnJAZ/B+SEdSUKIugZrtlNWMdf4I3Wbl
Fe8DcuO9V3a++Kdv/Ky/gT5FkKugqSyzUwrThHf83JyJZU5WjZRD/xlKYl5JVrkM
mcBcIM/1r/PJxzT3lnIfw8tLIJe22NH+nf46OVD9qid1vVc5ViGdzGRfqCCD+ohZ
f6AX1TtThB1HIZj9Pk7JdE3G4+Rh5ie1zz5fGwddxhHqes8FNWw=
=4yy0
-----END PGP SIGNATURE-----