Matthew Garrett on Nostr: Today's discovery: gcc will remove calls to memcpy() with a len of 0 (good), knows ...
Today's discovery: gcc will remove calls to memcpy() with a len of 0 (good), knows it's UB to call memcpy() with a dest of NULL (spec compliant), will assume that dest can't be NULL (fucking compilers, man), will combine both to engage in this UTTERLY PATHOLOGICAL BEHAVIOUR
https://godbolt.org/z/cPdx6v13rPublished at
2024-12-11 15:33:09Event JSON
{
"id": "f56c42429a805007be57b8aed3283d560c777a3e36fc53a96a36010fe5a65bec",
"pubkey": "ef5e80e6c74387ef14f5c6b89079f22b6847dc14365001c0ed662a20bd891677",
"created_at": 1733931189,
"kind": 1,
"tags": [
[
"proxy",
"https://nondeterministic.computer/users/mjg59/statuses/113634914448658310",
"activitypub"
]
],
"content": "Today's discovery: gcc will remove calls to memcpy() with a len of 0 (good), knows it's UB to call memcpy() with a dest of NULL (spec compliant), will assume that dest can't be NULL (fucking compilers, man), will combine both to engage in this UTTERLY PATHOLOGICAL BEHAVIOUR https://godbolt.org/z/cPdx6v13r",
"sig": "cbf3d598d455143d69a74fcdffbdc8b6a5ca4f169b94d4ebd4a5076257a188853a33123690a88ba964c1e1db49153c92bc79a8caca6a83107ebf7afc0b159500"
}