|
|
|
|
|
by loeg
2251 days ago
|
|
You're being unnecessarily combative. > No. You are wrong. There are no words in the standard that say that “basic types cannot overlap in memory”. § J.2, Undefined Behavior An object is assigned to an inexactly overlapping object or to an exactly overlapping object with incompatible type (6.5.16.1). > There is not even a notion of “basic type”. "Object." You repeatedly (in this thread, and on your blog) express that you don't really understand "strict" (ISO standard) aliasing rules, and that seems to be the case. |
|
You keep quoting this clause as if it applied to any of the assignments in the program being discussed.
It doesn't.
That clause says that in an assignment of the form “lvalue1 = lvalue2;”, there must only be exact overlap or no overlap between lvalue1 and lvalue2. This does not apply to assignments of the form “lvalue = 1;” or “lvalue = 2;” which are the interesting assignments in the program being discussed.
Objects are not “basic types” for the original sentence that claimed that “basic types cannot overlap in memory”. Objects overlap in memory all the time.
> You repeatedly (in this thread, and on your blog) express that you don't really understand "strict" (ISO standard) aliasing rules, and that seems to be the case.
If you say so. I'm not the one who thinks that “* p” and “1” overlap.