From a previous thread: "How the compiler implements this facet {stucts as return values} of ANSI C is of no concern to me unless I'm worried about efficiency." Reply: Great, another wrong sweeping statement. I would post a counter example, but I already did in the thread "Problem with structs as return values". Of course, if one believes 3 equals to 4 then my counter example fails. For those of you who do not believe 3 equals to 4, you must accept the fact that there are times you have to worry about Keil deviation from the ANSI C standard with respect to stucts as return values.
Which is why it's bad that Keil have not documented their implementation in the manuals (nor anywhere else, as far as I can see) It might all be a cunning ploy which relies upon the way C51 uses fixed memory locations (instead of the stack) to implement locals...?
I'm sorry I so offend you.
You're right. I took it it too personal. After 9 years of court battles with my Ex, I jump on anyone who slightly hints at saying something that I think might be false. I will tone down any comments I make in the future.
No problem. I will do some tests to see how badly C51 handles structs as a return object. Then I'll ask my purist friends over at comp.lang.c for comments. We'll get to the bottom of this. Regards. - Mark