Making memcpy(NULL, NULL, 0) well-defined

234 · Red Hat · Dec. 11, 2024, 7:36 a.m.
Summary
This blog post discusses the acceptance of N3322 for C2y, which removes undefined behavior from certain zero-length operations using NULL pointers in the C programming language, making operations like memcpy(NULL, NULL, 0) well-defined. It explains the implications for compiler optimizations and constants in functions, as well as the discussion and opposition faced during its proposal, ultimately leading to the recommendation for retroactive application of the change.