1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > aix c语言 数字转字符串 AIX Server下面ld C语言出警告 居然不能用%操作 该如何处理...

aix c语言 数字转字符串 AIX Server下面ld C语言出警告 居然不能用%操作 该如何处理...

时间:2022-11-15 02:48:23

相关推荐

aix c语言 数字转字符串 AIX Server下面ld C语言出警告 居然不能用%操作 该如何处理...

AIX Server下面ld C语言出警告 居然不能用%操作,该如何处理

AIX Server下面ld C语言出警告 居然不能用%操作,该如何处理

日期:-05-16 浏览次数:20366 次

AIX Server下面ld C语言出警告 居然不能用%操作

简单的C程序

#include

#include

typedef struct _RandInfo {

int iMin;

int iMax;

int iRand;

} RandInfo;

void JMYTSXZCRAND(RandInfo *rndInf)

{

int tmp, rnd, bas;

printf( "%d\n ",rndInf-> iMin);

printf( "%d\n ",rndInf-> iMax);

if (rndInf-> iMax > rndInf-> iMin)

{

printf( "if\n ");

tmp = (int)(((rndInf-> iMax) + 1) - (rndInf-> iMin));

printf( "tmp=%d\n ",tmp);

rnd= rand();

printf( "rnd=%d\n ",rnd);

bas = rnd % tmp; /*

rndInf-> iRand = bas + (rndInf-> iMin);

}

else

rndInf-> iRand = rndInf-> iMin;

}

使用下面的makefile编译链接,居然出Warning。

但是如果把取模操作注释掉就没事了。

难道是我的makefile里面没有找到c编译器关于取模操作的lib?

makefile:

libTESTC.a : test_c.o

/usr/bin/ld -o libTESTC.a -G -bexpall -bnoentry test_c.o

test_c.o : test_c.c

/usr/vac/bin/xlc -Aa -c -I/usr/include -I/opt/hitachicodecnv/include -I/include test_c.c -o test_c.o

编译错误:

/usr/vac/bin/xlc -Aa -c -I/usr/include -I/opt/hitachicodecnv/include -I/include test_c.c -o test_c.o

/usr/bin/ld -o libTESTC.a -G -bexpall -bnoentry test_c.o

ld: 0711-768 WARNING: Object test_c.o, section 1, function .__divss:

The branch at address 0xa8 is not followed by a recognized no-op

or TOC-reload instruction. The unrecognized instruction is 0x60850000.

/opt/HILNGcbl/bin/ccbl -d -C2 -P3 -T1 -T2 -T6 -Un -X5 -Mw test_cbl.cbl

/usr/vac/bin/xlc -o TESTCBL -bdynamic -brtl -blibpath: -L/usr/lib -lm -lc -lbsd -L/opt/HILNGcbl/lib -lcbl85 -lcb

l85ml -lcbl85cgi -L./ -lTESTC test_cbl.o

------解决方案--------------------

不清楚那里的问题,应该不是 "% "的问题,检查前面是不是有别的错误.

------解决方案--------------------

编译时加上如下的选项

-qprocimported=__divss

免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。