gcc std=c99

来源:互联网 发布:aoi编程技工 编辑:程序博客网 时间:2024/06/05 17:50

问题:

error: 'asm' undeclared (first use in this function)


原因:

使用了旧的命名法,但使用了新的编译器,导致新的编译器,没有将旧的命令识别为关键字


修改方法

将asm改为__asm__


原文档

https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-std-112

Do not recognize asm, inline or typeof as akeyword, so that code can use these words as identifiers. You can usethe keywords__asm__, __inline__ and __typeof__instead.-ansi implies -fno-asm



0 0
原创粉丝点击