G
gobo20
i'm trying to port some old code to a more current linux compiler.
i've run into an error that i
have been at a loss to correct. the following, very brief, sections
compile and generate executables
under pcdos turbo-c and gcc 3.3.6 (slackware 10.1). i've not included
much code, so i hope
someone has come across this before and can recognize it.
this is defined in .h:
typedef struct {
unsigned attr;
unsigned valu;
char oname[7];
} OPCODE;
code section with error:
110 OPCODE *find_code(nam)
111 char *nam;
112 {
113 OPCODE *bsearch();
114
115 static OPCODE opctbl[] = {
116 { AJMP, 0x11,
"ACALL" },
117 { ADD + ((R7 - A) << 5) + A, 0x24,
"ADD" },
under gcc 4.2.1 (suse 10.3) i get the following error:
util.c:113: error: conflicting types for ‘bsearch’
/usr/include/stdlib.h:775: error: previous declaration of ‘bsearch’
was here
i did not write this code and i'm still trying to understand the
authors use of
bsearch return as a pointer. problem is, i know it "used" to work...
any suggestions?
thanks.
i've run into an error that i
have been at a loss to correct. the following, very brief, sections
compile and generate executables
under pcdos turbo-c and gcc 3.3.6 (slackware 10.1). i've not included
much code, so i hope
someone has come across this before and can recognize it.
this is defined in .h:
typedef struct {
unsigned attr;
unsigned valu;
char oname[7];
} OPCODE;
code section with error:
110 OPCODE *find_code(nam)
111 char *nam;
112 {
113 OPCODE *bsearch();
114
115 static OPCODE opctbl[] = {
116 { AJMP, 0x11,
"ACALL" },
117 { ADD + ((R7 - A) << 5) + A, 0x24,
"ADD" },
under gcc 4.2.1 (suse 10.3) i get the following error:
util.c:113: error: conflicting types for ‘bsearch’
/usr/include/stdlib.h:775: error: previous declaration of ‘bsearch’
was here
i did not write this code and i'm still trying to understand the
authors use of
bsearch return as a pointer. problem is, i know it "used" to work...
any suggestions?
thanks.