Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jech
1 day ago
|
parent
|
context
|
favorite
| on:
Thoughts on Go vs. Rust vs. Zig
> Give an example of UB code that you have committed in real life
struct foo { ... atomic_int v; ... }; struct foo x; memset(&x, 0, sizeof(x));
rwbt
1 day ago
[–]
I don't think it's UB if you init the struct before using it atomically from multiple threads.
reply
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: