Does C have a standard ABI?

前端 未结 8 1980
谎友^
谎友^ 2020-11-28 06:34

From a discussion somewhere else:

C++ has no standard ABI

But neither does C, right?

On any given platform it pretty much does. It wouldn\'

8条回答
  •  鱼传尺愫
    2020-11-28 07:10

    The ABI for C is platform specific - it covers issues such as register allocation and calling conventions, which are obviously specific to a particular processor. Here are some examples:

    • The ARM ABI (includes C++)
    • The PowerPC Embedded ABI
    • The several ABIs of x86

    x86 has had many calling conventions, which extensions under Windows to declare which one is used. Platform ABIs for embedded Linux have also changed over time, leading to incompatible user space. See some history of the ARM Linux port here, which shows the problems in the transition to a newer ABI.

提交回复
热议问题