Hi Martin,

On 2/17/23 14:48, Martin Uecker wrote:
This new wording doesn't even allow one to use memcmp(3);
just reading the pointer value, however you do it, is UB.

memcmp would not use the pointer value but work
on the representation bytes and is still allowed.

Hmm, interesting. It's rather unspecified behavior. Still unpredictable: (memcmp(&p, &p, sizeof(p) == 0) might evaluate to true or false randomly; the compiler may compile out the call to memcmp(3), since it knows it won't produce any observable behavior.

<https://software.codidact.com/posts/287905>

Cheers!

Alex

--
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to