Skip to contentSkip to conversation

C undefined behavior fix

PATCH [email protected] 1 participant 1 message Jan 9, 2002

lore
Share & tools
lore
#0 lore raw

<<and we load each one into our app, and place c1, c2 and c3 immediately next to each other, and then run foo1, then foo2, then foo3, and then check the side effects, c1, c2 and c3, I would claim we _must_ get write 1 c1, write 2 c2, write 3 c3, and at the end, c1, c2 c3 should be 1,2,3. I find it obvious.

Quoted 1 line
Quoted 1 line

Yes, of course! No one disagrees. I am talking about *LOADS* not stores, your example is 100% irrelevant to my point, since it does stores.

If you think I was talking about stores (look back in the thread, you will see that is your misconception), then no WONDER you are puzzled by what you *thought* I said :-)

<<In part, it is because gcc has adopted this model of independent translation units, that makes it a hard requirement in the case above, for the accesses to be byte based. Because if it had not, gcc would not be able to implement the intended required semantics of each of the units. The requirements of the standard forced this because of the implementation choice.

Quoted 1 line
Quoted 1 line

All this is true, but totally irrelevant to the point I was making, which was about loads, not stores.

Quoted 1 line
Quoted 1 line

Welcome to the world of programming.

If you feel that I need a welcome to the world of programming (in which I have lived for 38 years, producing several million lines of delivered commercial code), then it is likely you are misunderstanding what I am saying :-)

Robert