我经常尝试使用最近的GCC构建大量旧的模拟器和磁盘和磁带归档工具.有些错误很容易解决,但我不是一个程序员.
我明白了:
itstar.c:在函数'addfiles'中:
itstar.c:194:4:警告:格式'%d'需要类型为'int'的参数,但参数2的类型为'long unsigned int'[-
Wformat ] itstar.c :194:4:警告:格式'%d'需要类型为'int'的参数,但参数3的类型为'long unsigned int'[-Wformat]
从这段代码片段:
/* add files to a DUMP tape */
/* output buffer must have been initialized with resetbuf() */
static void addfiles(int argc,char **argv)
{
int c=argc;
char **v=argv;
while(c--) {
addfile(argc,argv,*v++);
}
if(verify)
printf("Approximately %d.%d' of tape used\n",count/bpi/12,
(count*10/bpi/12)%10);
}
Run Code Online (Sandbox Code Playgroud)
第194行是最后一行,从printf开始.
该文件是itstar.c,来自tapetools,代码在这里.
尽管有警告,它仍会构建,但我更愿意知道如何防止它,
因此结果更有效,并且数据损坏的可能性更小.
拜托,我错过了什么,需要改变?
先感谢您.