我绝对不是一个程序员,但我正在尝试将一个非常老的程序从fortran编译成C,这样我就可以玩一个我在20+多年没有玩过的游戏(最初是在70年代末在HP3000上创建的!)在我的linux机器上。
有人用f2c (fortran to C)写了一个make.sh文件,这样它就可以在linux下用GCC编译了,但那已经是很久以前的事了。
我收到以下错误消息:
stubs.c: In function ‘exexc_’:
stubs.c:76:13: warning: implicit declaration of function ‘mmsa_’; did
you mean ‘memset’? [-Wimplicit-function-declaration]
case 'A': mmsa_(); break;stubs.c中的相关代码片段(即exexc函数)如下:
#include <setjmp.h>
int setjmp(jmp_buf env);
void exexc_(name, i1, i2, i3, i4, i5, namelen)
char *name;
shortint *i1, *i2, *i3, *i4, *i5;
long namelen;
{
static jmp_buf env;
static int first = 1;
static char segment[6];
ipx[0] = *i1;
ipx[1] = *i2;
ipx[2] = *i3;
ipx[3] = *i4;
ipx[4] = *i5;
strncpy(segment, name, namelen);
if( ! first ) longjmp(env, 1);
if( first )
{
first = 0;
setjmp(env);
switch(segment[3]) {
case 'A': mmsa_(); break;
case 'B': mmsb_(); break;
case 'C': mmsc_(); break;
case 'D': mmsd_(); break;
case 'E': mmse_(); break;
case 'F': mmsf_(); break;
case 'G': mmsg_(); break;
case 'H': mmsh_(); break;
case 'I': mmsi_(); break;
case 'J': mmsj_(); break;
case 'K': mmsk_(); break;
case 'L': mmsl_(); break;
default:
fprintf(stderr, "Whoa, attempted to call segment %s\n", segment);
fflush(stderr);
exit(1);
}
fprintf(stderr, "Oops, segment %s didn't call next segment\n", segment);
fflush(stderr);
exit(2);
}
}为了声明'case 'A':mmsa_()‘函数,我需要在stubs.c文件中修改什么?如果有帮助,那么mmsa引用了同一本地目录中的另一个文件,我认为是mmsa.c。
如果你需要的话,很乐意提供更多的信息。我已经超过20+ (!)年没有玩过这个游戏了,所以如果有任何帮助,我将不胜感激。
https://stackoverflow.com/questions/51350455
复制相似问题