3 ms·
Nope, the C spec is just really bad. The NULL check is allowed to be removed.
by adgjlsfhk1 4y ago
Nope, the C spec is just really bad. The NULL check is allowed to be removed.
- mnw21cam 4y agoSo the pseudocode: if (p is not NULL) { dereference p } is UB? That's crazy, but not actually unbelievable.
- dllthomas 4y agoI am not certain of the language lawyer side of it, but no reasonable (or even moderately unreasonable) compiler would omit that check because of the guarded behavior; way too much code would break, probably including that compiler's standard library.
- UncleMeat 4y agoThe poster is just completely wrong. A compiler is required to emit the branch in this case.