4
0
0

编译选项

2026-09-04
2026-09-15

-fgnu89-inline

在c99标准和gnu89标准下对应inline内联的行为是不一样的,

而切到 C99 语义后,inline / extern inline 对“是否生成可链接的函数符号”的规则恰好有明显差异,因此老项目可能出现:

  • undefined reference to xxx(缺少外部函数定义)

  • multiple definition of xxx(重复定义)

这时有的项目会加 -fgnu89-inline 来保持历史行为,尤其是移植旧 GCC/旧内核风格代码时。

Support

If this article helped you, feel free to share it or give support!