Re: Brief C23 excursion

Alejandro Colomar via Mutt-dev <[email protected]>
Newsgroups gmane.mail.mutt.devel
Message-ID <aeI3RfuxETyfLCRE@devuan>
Hi Ian,

On 2026-04-17T13:13:39+0100, Ian Collier via Mutt-dev wrote:
> On Thu, Apr 16, 2026 at 01:22:24PM +0200, Alejandro Colomar via Mutt-dev wrote:
> > I've implemented a patch for musl (which hasn't been merged yet).
> > It only needs C11 features.
> 
> > 	#define __QVoidptrof(p)  typeof(1?(p):(void*){0})
> > 	#define __QCharptrof(s)  typeof                               \
> > 	(                                                             \
> > 		_Generic((__QVoidptrof(s)){0},                        \
> > 			const void *: (const char *) 0,               \
> > 			void *:       (char *) 0                      \
> > 		)                                                     \
> > 	)
> 
> [Sorry for the slightly off-topic discussion]
> 
> Correct me if I'm wrong, but that's going to barf if I perversely
> declare my character pointer as volatile and pass it to one of
> these functions, yes?  (It would otherwise just be a warning.)

Yes, and that's A Good Thing(tm).  Previously, it was just a warning,
but it had Undefined Behavior, which you certainly didn't want.


Have a lovely day!
Alex

> 
> Ian Collier.

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

iQIzBAABCgAdFiEES7Jt9u9GbmlWADAi64mZXMKQwqkFAmniN6kACgkQ64mZXMKQ
wqn4Iw//T99JNxswMzNRgAZ+8XqZG9UIBFokXGp7/kIHq0wOSggaDfqVhuZ5d7Zq
3fsyI33TqxR8AkN6iZHE/DVuJK5OM0ibodywSuXTjZxVh5eFg37U+nr9hoqiuycS
PnFBGqjcKuX3jowXa0+0Bj7bjSBAmZC+lJ8ng8yoRvwuf55DOP7kd/Yk/8y+S+25
pkoZvOvVHLh9P3HRL4MsUkQV80bpVYyMf6whyD1mQ6a6sB7Fa+m/qyz96hZ3pDZ2
e1ZuIaeux4rnkKRVjn1Be5jb8j3qPEpQ7MZaYZCsMmx4Vfl03GpflOpEr9vt1+eJ
kYF6QL8afjmuwuH3oZYHypQ/78tDghYnt19IX5x+P+xeAkXzStbsABeTD0ZejGGz
hz9Kl6l1wwwl8oQxPqCcqhgWMPtebwJrsaBMzL7jVIpDQHIP79pX4hKbSeGqmDZv
aTtqRC5P9jQ170NgO8WZ/Q3tt9hS1n05uqPOPaaxj8vhQqcv6x87CT9+RywR6x9C
FvKgn81VZrshUVxBSDACL3n4MtmTkzdQGNQa42i2fKMgWw9UiugYfZTxaLeOnyEP
SJpwPFBWmDZolvDfEOAJpAaJITfNSHTCr3j+eHVcVoQ68xJbuzd9I9C9abBkaxb1
ivrhb9oy3QAa1mHHw0lvXRUyq0LXwKSuYf1blzGpctawR/QdnuY=
=uZ8z
-----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.