How does returning values from a function work?

后端 未结 8 1612
被撕碎了的回忆
被撕碎了的回忆 2021-01-05 12:16

I recently had a serious bug, where I forgot to return a value in a function. The problem was that even though nothing was returned it worked fine under Linux/Windows and on

8条回答
  •  清酒与你
    2021-01-05 12:19

    Probably by luck, 'a' left in a register that happens to be used for returning single pointer results, something like that.

    The calling/ conventions and function result returns are architecture-dependent, so it's not surprising that your code works on Windows/Linux but not on a Mac.

提交回复
热议问题