const char c; memcpy(&c, "a", 0); discuss
-
-
-
Replying to @ircncl
No-one said you couldn't pass 0 to memcpy. The standard only 1) says it will copy len chars, and 2) has an interesting note for 0…
1 reply 0 retweets 0 likes -
Replying to @volatile_void @ircncl
Note about 0: https://port70.net/~nsz/c/c11/n1570.html#7.1.4p1 … https://port70.net/~nsz/c/c11/n1570.html#7.24.1p2 …
1 reply 0 retweets 0 likes -
Replying to @volatile_void @ircncl
clang warns on the deconsting, appears to safely execute no-op, which seems sensible
2 replies 0 retweets 0 likes
Replying to @mister_borogove @ircncl
The warning indicates a constraint violation here; you need a cast to make it even valid to compile. Whether UB happens is another question.
11:43 AM - 21 Sep 2017
0 replies
0 retweets
0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.