Re: Brief C23 excursion (was: Minor cleanup after adding more warnings to CFLAGS)

"Kevin J. McCarthy" <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aeC7J2X9mkVyUMn1@qinghai>
On Thu, Apr 16, 2026 at 08:38:50AM +0200, Matthias Andree via Mutt-dev wrote:
>Am 16.04.26 um 06:52 schrieb Kevin J. McCarthy:
>>
>>So... I guess this is C23.  Which I know almost nothing about :-D.  
>>In any case, we're a long ways away from getting to that level of C 
>>standard support in Mutt.
>
>It's actually a C11 feature that is finally leveraged in the C23 
>stdlib.h, see https://en.cppreference.com/w/c/language/generic.html or https://stackoverflow.com/questions/9804371/syntax-and-sample-usage-of-generic-in-c11 
>or https://learn.microsoft.com/en-us/cpp/c-language/generic-selection?view=msvc-170

Thank you, Matthias.  Those links are really helpful.  Starts to turn 
line noise into something I can understand!

>1. C23 CHANGES INCOMPATIBLY how a function _declaration_ without 
>arguments is interpreted.
>
>As of C23, int func() means the same as int func(void), must/will not 
>take arguments, where C18 and before interpreted "has no prototype, 
>any number of arguments is fine", although that had been deprecated 
>since C99 or so.

It wasn't that long ago that I start converting some func() declarations 
inside mutt to func(void).  I'll count myself lucky that we didn't 
happen to have those kinds of problems in our configure.ac too!

-- 
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEiXWpszqjeRA4XFMIre92hIAxa9oFAmnguycACgkQre92hIAx
a9rQXA/9FKUobuJJw3pJw5dnInyDBmpJ/wsu89B9ZHN53mJvxHvZSil/etPH5FZv
LnhvkDShe8RoJn6p1EaCKKzsfAOoIFWILHumM+at5zBBj+Ce9c99V0O7ncov32AP
5xIIf/s/7Ign9wiNrRSWmKh5dT9AwuQvPM03PbnvAb0RPda6uKdyOg1NRq1GL/jk
NMs0hTH6lzHphcrWx6tv0cjEDFlAi5veyozyHpXDMkBAL0gfrV2ZyBhQnkCuDDFX
Oz3a3+EyCWsmDu/5HmToFqAY3jqBsce24k1JFkM+s1Y5kYa7/lG3WjXc/0MnaTb9
Au50Og17Td5SJjT6KO1FyvstH7i0ejKwn6WmTG32YDJN8lupb9vBzZiG2FuLSmMc
RSIVCInyQSXEDEYcZKyKmbvb1SkYwVZXEe/ydnkihA4i7ZJn4ipyw+kHcXBl9LH8
1K3cF6Ub1VLe+qQTwGQmxtt8ctPLaHWFrlv4VTOoq7RElSyxnlzObAyOA3srd7d9
+NKz7G0ceV7zzeAxY/eoqZsE3s6RuJHqJFd0WibKrDB48hlTCoTMXiBWNC8YI1D7
3INr5Qli+yWB62MUnakNPOvsIe80/QDDXMXD/Pa5dam9K1jONMNknFMkEhVIyOsM
GNbTZMJm4xEtZXkrq+BDHqmY5maw8LCZtol9u35JMQ9RllLHJgY=
=xsF4
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.