Rom 2.4 and GCC4

Posted by Samson on Sun 08 May 2005 08:07 PM — 5 posts, 23,192 views.

USA #0
This one seems simple enough - not sure why they chose to just up and change it but they did. In tables.h, at the top end of the file you have this set of declarations:


/* game tables */
extern	const	struct	clan_type	clan_table[MAX_CLAN];
extern	const	struct	position_type	position_table[];
extern	const	struct	sex_type	sex_table[];
extern	const	struct	size_type	size_table[];

/* flag tables */
extern	const	struct	flag_type	act_flags[];
extern	const	struct	flag_type	plr_flags[];
extern	const	struct	flag_type	affect_flags[];
extern	const	struct	flag_type	off_flags[];
extern	const	struct	flag_type	imm_flags[];
extern	const	struct	flag_type	form_flags[];
extern	const	struct	flag_type	part_flags[];
extern	const	struct	flag_type	comm_flags[];
extern	const	struct	flag_type	extra_flags[];
extern	const	struct	flag_type	wear_flags[];
extern	const	struct	flag_type	weapon_flags[];
extern	const	struct	flag_type	container_flags[];
extern	const	struct	flag_type	portal_flags[];
extern	const	struct	flag_type	room_flags[];
extern	const	struct	flag_type	exit_flags[];


These need to all be moved down to the end of the file, past the last struct that's defined here. Once you've moved them, all is well and your code will once again compile.
#1
I fixed this problem, as told above, only to get more errors.

[root@localhost src]# make
gcc -c -Wall -O -g act_comm.c
gcc -c -Wall -O -g act_enter.c
gcc -c -Wall -O -g act_info.c
act_info.c: In function 'do_look':
act_info.c:1161: warning: suggest explicit braces to avoid ambiguous 'else'
act_info.c:1170: warning: suggest explicit braces to avoid ambiguous 'else'
gcc -c -Wall -O -g act_move.c
gcc -c -Wall -O -g act_obj.c
act_obj.c: In function 'do_put':
act_obj.c:424: warning: suggest explicit braces to avoid ambiguous 'else'
act_obj.c:462: warning: suggest explicit braces to avoid ambiguous 'else'
act_obj.c: In function 'get_cost':
act_obj.c:2481: warning: suggest explicit braces to avoid ambiguous 'else'
gcc -c -Wall -O -g act_wiz.c
gcc -c -Wall -O -g alias.c
gcc -c -Wall -O -g ban.c
gcc -c -Wall -O -g comm.c
comm.c:184: error: conflicting types for 'read'
/usr/include/unistd.h:327: error: previous declaration of 'read' was here
comm.c:188: error: conflicting types for 'write'
/usr/include/unistd.h:333: error: previous declaration of 'write' was here
comm.c: In function 'turn_on_mxp':
comm.c:445: warning: pointer targets in passing argument 2 of 'write_to_buffer' differ in signedness
comm.c: In function 'init_descriptor':
comm.c:934: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness
comm.c:935: warning: pointer targets in passing argument 3 of 'accept' differ in signedness
comm.c:965: warning: pointer targets in passing argument 3 of 'getpeername' differ in signedness
comm.c: In function 'read_from_buffer':
comm.c:1189: warning: pointer targets in assignment differ in signedness
comm.c:1192: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1196: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1196: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1196: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1199: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1203: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1203: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c:1203: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness
comm.c: In function 'nanny':
comm.c:1877: warning: pointer targets in passing argument 2 of 'write_to_buffer' differ in signedness
make: *** [comm.o] Error 1

what should I do now?
Amended on Thu 14 Feb 2008 01:07 AM by Nick Gammon
USA #2
These are the errors:
comm.c:184: error: conflicting types for 'read'
/usr/include/unistd.h:327: error: previous declaration of 'read' was here
comm.c:188: error: conflicting types for 'write'
/usr/include/unistd.h:333: error: previous declaration of 'write' was here


Can you show us those lines?
Amended on Thu 14 Feb 2008 01:08 AM by Nick Gammon
Australia Forum Administrator #3
‘ and ’ in your original posts are just Unicode for opening and closing quotes, I have taken the liberty of replacing those to make the errors more readable.
Australia Forum Administrator #4
Personally I wouldn't compile as root, too many chances of things going wrong.

Is this Linux or Cygwin?