嗨,上面的一些问题在GCC文档中得到回答:HTTPS://Gcc.GNUGOR/ONLIDEOCS/GCC/ExtDeD-ASM.HTMLASM和Y-AASMYI以相同的方式工作,但是这两种形式都是标准化C语言定义的扩展。因此,在严格解释C语言规则时,ASM应该是变量的名称,或者ASM(…)可以调用的函数的名称。如果使用更严格的语言标准选项编译,如-ANSI或-STD=……,它们仍然会被接受。在编译器命令行中。迈西尔
以上来自于百度翻译
以下为原文
Hi,
Some of the questions above are answered in GCC documentation:
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
asm and __asm__ work the same way,
but both forms are extensions to the standardized C language definitions.
In C language, there is a set of keywords that have defined meaning in the language, and asm is not one of those.
So in strict interpretation of C language rules, asm should be the name of a variable, or asm(...) the name of a function that may be called.
Keywords with double underscore: __something or __something__
is a way of using features of the compiler, without breaking language rules.
They will still be accepted if compiled with more strict language standard options,
like -ansi or -std=... in compiler command line.
Mysil
嗨,上面的一些问题在GCC文档中得到回答:HTTPS://Gcc.GNUGOR/ONLIDEOCS/GCC/ExtDeD-ASM.HTMLASM和Y-AASMYI以相同的方式工作,但是这两种形式都是标准化C语言定义的扩展。因此,在严格解释C语言规则时,ASM应该是变量的名称,或者ASM(…)可以调用的函数的名称。如果使用更严格的语言标准选项编译,如-ANSI或-STD=……,它们仍然会被接受。在编译器命令行中。迈西尔
以上来自于百度翻译
以下为原文
Hi,
Some of the questions above are answered in GCC documentation:
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html
asm and __asm__ work the same way,
but both forms are extensions to the standardized C language definitions.
In C language, there is a set of keywords that have defined meaning in the language, and asm is not one of those.
So in strict interpretation of C language rules, asm should be the name of a variable, or asm(...) the name of a function that may be called.
Keywords with double underscore: __something or __something__
is a way of using features of the compiler, without breaking language rules.
They will still be accepted if compiled with more strict language standard options,
like -ansi or -std=... in compiler command line.
Mysil
举报