英文:
GNU as: Escape symbol names in intel_syntax
问题
使用GNU as的.intel_syntax
,一些标识符显然会变成关键字,比如写下以下代码来调用名为and
的函数:
call and
会导致以下错误:
Error: invalid use of operator "and"
你如何绕过这个问题?
英文:
With GNU as .intel_syntax
, some identifiers apparently become keywords, and writing e.g.
call and
to invoke a function called and
results in
Error: invalid use of operator "and"
How do you circumvent this?
答案1
得分: 2
好的,答案似乎是:
这是不可能的。使用AT&T语法。
查看GAS源代码,config/tc-i386-intel.c
的136行及之后对此有很明确的说明。
某些GNU开发者认为完全禁用某些符号名称是引入命名操作符的一种合理方式。这样一个小而不好的设计决策让我以及可能还有许多其他不幸的用户浪费了整个下午的时间。不要成为那个人。
英文:
Alright, the answer seems to be:
This is not possible. Use AT&T syntax.
Looking at the GAS sources, config/tc-i386-intel.c
lines 136ff are pretty clear about this.
Some GNU developer considered completely disabling some symbol names to be a reasonable way of introducing named operators. Such a small bad design decision cost me and probably many other unfortunate users a whole afternoon. Don't be that guy.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论