Warfare Errors

Posted by Lupercus on Thu 28 Mar 2002 03:43 AM — 2 posts, 11,591 views.

#0
Okay, got some code for a warfare system, added everything in that was needed. Compiled got a whole bunch of errors. Fixed some stuff up. Compiled again. Got more errors. Now, I'm having trouble.
fight.c, handler.c and war.c are messed up with all kinds of errors and I'm not sure how to fix them. I'll put handler.c here first. Its got most errors I think.

gcc handler.c -Wall -O -ggdb -DNOCRYPT -c -o obj/handler.o
handler.c: In function `extract_char':
handler.c:2160: warning: implicit declaration of function `wartalk'
handler.c:2137: warning: unused variable `wch'
handler.c:2138: warning: unused variable `obj'
handler.c:2139: warning: unused variable `obj_next'
handler.c: At top level:
handler.c:2189: parse error before "if"
handler.c:2192: parse error before numeric constant
handler.c:2192: warning: type defaults to `int' in declaration of `stop_fighting
'
handler.c:2192: conflicting types for `stop_fighting'
merc.h:2589: previous declaration of `stop_fighting'
handler.c:2192: warning: data definition has no type or storage class
handler.c:2194: warning: type defaults to `int' in declaration of `obj'
handler.c:2194: invalid type argument of `->'
handler.c:2194: parse error before ')' token
handler.c:2197: warning: type defaults to `int' in declaration of `extract_obj'
handler.c:2197: warning: parameter names (without types) in function declaration
handler.c:2197: conflicting types for `extract_obj'
handler.c:2084: previous declaration of `extract_obj'
handler.c:2197: warning: data definition has no type or storage class
handler.c:2198: parse error before '}' token
handler.c:2219: warning: type defaults to `int' in declaration of `wch'
handler.c:2219: invalid type argument of `->'
handler.c:2219: parse error before ')' token
handler.c:2235: warning: type defaults to `int' in declaration of `prev'
handler.c:2235: invalid type argument of `->'
handler.c:2235: parse error before ')' token
handler.c:2253: warning: type defaults to `int' in declaration of `free_char'
handler.c:2253: warning: parameter names (without types) in function declaration
handler.c:2253: conflicting types for `free_char'
recycle.h:89: previous declaration of `free_char'
handler.c:2253: warning: data definition has no type or storage class
handler.c:2254: parse error before "return"
handler.c: In function `affect_bit_name':
handler.c:2910: warning: control reaches end of non-void function
make: [obj/handler.o] Error 1 (ignored)

Some of these, I've never seen. And I've got no idea on how to fix them. Thought this would be a good place to check.

Lupercus
Australia Forum Administrator #1
"implicit declaration" means it doesn't know what that does. Maybe a missing .h file?

"parse error" could be almost anything. Check the code around the line in question.