Using the “naked” attribute for functions in GCC

后端 未结 3 773
一个人的身影
一个人的身影 2020-12-09 10:41

GCC documentation states in 6.30 Declaring Attributes of Functions:

naked

Use this attribute on the ARM, AVR, IP2K, RX and SPU ports

3条回答
  •  借酒劲吻你
    2020-12-09 11:05

    The only statements that can be safely included in naked functions are asm statements that do not have operands. All other statements, including declarations of local variables, if statements, and so forth, should be avoided.

    Based on the description you already gave, I would assume that even function calls are not suitable for the "naked" keyword.

提交回复
热议问题