‘asm’ operand has impossible constraints
来源:互联网 发布:js滑动到底部加载更多 编辑:程序博客网 时间:2024/06/04 08:31
1 环境说明
Ubuntu14.04.2(64bit)+ gcc-4.8.2
2 问题描述
当在c中内联汇编时,出现如题错误。
3 可能原因1
将同一变量同时用于输出寄存器列表可返回值,会导致此错误,只要将其中之一去除就好。
int StrnCmp(const char *cs, const char *ct, int count){ register int __res; asm("" :"=a"(__res) // 输出寄存器列表 :"D"(cs), "S"(ct), "c"(count) :"si", "di", "cx"); return __res; // 返回}
将一个指定了寄存器的变量用于输出寄存器列表,会导致此错误,只要将其中之一去除就好。
void StrnCmp(const char *cs, const char *ct, int count){ register int __res asm("ax");// 指定__res使用寄存器eax asm("" :"=a"(__res) // 返回寄存器列表 :"D"(cs), "S"(ct), "c"(count) :"si", "di", "cx");}
0 0
- ‘asm’ operand has impossible constraints
- error: ‘asm’ operand has impossible constraints
- OPENWRT编译问题:inconsistent operand constraints in an 'asm'
- ./arch/arm/include/asm/barriers.h:33:24: error: operator '>=' has no left operand
- error: impossible constraint in `asm' 解决办法
- 交叉编译问题: impossible constraint in 'asm'
- error: base operand of ‘->’ has non-pointer type ‘JNIEnv’
- JNI: error: base operand of ‘->’ has non-pointer type ‘JNIEnv’
- [Error] base operand of '->' has non-pointer type 'stac
- CONSTRAINTS
- constraints
- Constraints
- android cmake编译faad库,出现 invalid operand for inline asm constraint 'M'错误
- bak 5. 编译libmad 出现error impossible constraint in “asm”时的解决办法.
- bak 5. 编译libmad 出现error impossible constraint in “asm”时的解决办法.
- Xcode部署应用时的 impossible constraint in asm 异常解决方法
- QT经典错误:/usr/include/qt4/QtCore/qatomic_i386.h:132: error: impossible constraint in 'asm'
- QT经典错误:/usr/include/qt4/QtCore/qatomic_i386.h:132: error: impossible constraint in 'asm'
- 核心动画之图片折叠和倒影
- eventlet引发的学习:python:单线程、多线程、多进程在计算方面的性能对比
- Stanford Segment 使用笔记
- Android-锁屏的应用
- 初次接触vue
- ‘asm’ operand has impossible constraints
- 学习OpenCV2 —— 直方图匹配
- 使用springmvc做项目时资源的的引入问题 (CSS/JS/IMAGES)
- *LeetCode 94. Binary Tree Inorder Traversal
- 学习OpenCV2——opencv2.4.8和opencv3的安装和配置
- 三种工厂模式的分析以及C++实现
- [理论原理][数学]逻辑运算
- Android 里的 Service 复习总结 上
- 学习Opencv2——粒子滤波Condensation算法