8 ms·
I frequently see the word "anymore" used in comments like this, but the aliasing rules and the rules on undefined behavior date from the C89 standard, and they
by not2b 6y ago
I frequently see the word "anymore" used in comments like this, but the aliasing rules and the rules on undefined behavior date from the C89 standard, and they weren't invented in 1989. By the early 80s compiler writers were already pointing out that strictly treating pointers as addresses and forbidding the compiler from making any assumptions about whether addresses could clash forced very slow code, meaning that any fast code had to be written in Fortran (which actually have tougher aliasing rules than C has; given two arrays passed into a function, the compiler is entitled to assume that they do not alias).
- ayende 6y agoImportant to note that DOS, one of the popular platforms in the 80s, didn't have linear address space. NEAR, FAR and LONG pointers could be constructed that two equal values would point to different locations in memory and two distinct values would point to the same object.