This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Correction on "structs as return values"

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.

Parents
  • 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...?

Reply
  • 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...?

Children
No data