【发布时间】:2010-05-22 21:33:16
【问题描述】:
如何从我使用过的 C 程序中获取汇编代码 recommendation
我在 Eclipse 中使用了类似 -c -fmessage-length=0 -O2 -S 的东西,但出现错误,提前感谢您的帮助
现在我有这个错误
atam.c:11: error: conflicting types for 'select'
/usr/include/sys/select.h:112: error: previous declaration of 'select' was here
atam.c:11: error: conflicting types for 'select'
/usr/include/sys/select.h:112: error: previous declaration of 'select' was here
这是我的功能
int select(int board[],int length,int search){
int left=0, right=length-1;
while(1){
int pivot_index=(right+left)/2;
int ordered_pivot=partition(board,left,right,pivot_index);
if(ordered_pivot==search){
return board[ordered_pivot];
}
else if(search<ordered_pivot){
right=ordered_pivot-1;
}
else{
left=ordered_pivot+1;
}
}
}
【问题讨论】:
-
Eclipse 不是 C 编译器,但我猜你使用 GCC 作为后端,所以
-S应该足够了