3 ms·
> [Go] is like C in that you can fit the whole language in your head. Go isn't like C in that you can actually fit the entire language in your head. Most of us
by throwaway894345 11mo ago
> [Go] is like C in that you can fit the whole language in your head.
Go isn't like C in that you can actually fit the entire language in your head. Most of us who think we have fit C in our head will still stumble on endless cases where we didn't realize X was actually UB or whatever. I wonder how much C's reputation for simplicity is an artifact of its long proximity to C++?
- kanbankaren 11mo ago30 years in C/C++ here. Give an example of UB code that you have committed in real life, not from blogs. I am genuinely curious.
- jech 11mo ago> 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 11mo agoI don't think it's UB if you init the struct before using it atomically from multiple threads.
- gf000 11mo agoAll the memory safety vulnerabilities, which are the majority of bugs in most C/C++ projects?