The (int) in those lines should be changed to (size_t). The reason being that on your particular system ( likely 64 bit ) the size of a pointer fits into a long but that code is trying to cast it into an int. size_t tells the compiler to use whatever the type is configured for on that machine.
The %d tags also need to become %zd tags so the sprintf knows to use the size_t when dealing with them.
cc1plus: warnings being treated as errors fight.c: In function âvoid violence_update()â: fight.c:234: warning: ISO C++ does not support the âzâ printf length modifier fight.c:234: warning: ISO C++ does not support the âzâ printf length modifier fight.c:234: warning: ISO C++ does not support the âzâ printf length modifier fight.c:234: warning: ISO C++ does not support the âzâ printf length modifier fight.c:239: warning: ISO C++ does not support the âzâ printf length modifier fight.c:239: warning: ISO C++ does not support the âzâ printf length modifier fight.c:239: warning: ISO C++ does not support the âzâ printf length modifier make[1]: *** [o/fight.o] Error 1 make: *** [all] Error 2
Well that's weird. What version of gcc are you using? I've never had it tell me %zd isn't supported. I'm not sure how else they'd expect to be able to printf with a size_t.
You can get around it for now though by switching to long instead of size_t and using %ld instead of %zd
Well that's weird. What version of gcc are you using? I've never had it tell me %zd isn't supported. I'm not sure how else they'd expect to be able to printf with a size_t.
You can get around it for now though by switching to long instead of size_t and using %ld instead of %zd
Funny thing I just realized, I'm looking in my Virtual Server details and your the one that created my server for me haha (I'm using arthmoor)
But anyway, it fixed Fight.c and now what do ya know a new error! :mad:
make -s swr Compiling o/fight.o…. Compiling o/handler.o…. handler.c: In function âOBJ_DATA* group_object(OBJ_DATA*, OBJ_DATA*)â: handler.c:2839: error: cast from âchar*â to âintâ loses precision handler.c:2839: error: cast from âchar*â to âintâ loses precision handler.c:2840: error: cast from âchar*â to âintâ loses precision handler.c:2840: error: cast from âchar*â to âintâ loses precision handler.c:2841: error: cast from âchar*â to âintâ loses precision handler.c:2841: error: cast from âchar*â to âintâ loses precision handler.c:2842: error: cast from âchar*â to âintâ loses precision handler.c:2842: error: cast from âchar*â to âintâ loses precision make[1]: *** [o/handler.o] Error 1 make: *** [all] Error 2
Well that's weird. What version of gcc are you using? I've never had it tell me %zd isn't supported. I'm not sure how else they'd expect to be able to printf with a size_t.
You can get around it for now though by switching to long instead of size_t and using %ld instead of %zd
why not %p for pointer
28 Feb, 2008, David Haley wrote in the 11th comment:
Votes: 0
Because they're size_t, not pointer, and you might not want it printed in hex. :tongue:
Zastko, those are caused by problems in the hashing macros… you might be able to get away with just not casting pointers to ints, although I'm not sure about that; you'd have to look at what exactly QUICKMATCH is doing.
Now I'm stuck on something else, I keep get this error when compiling:
make -s swr
Compiling o/act_info.o….
Compiling o/act_move.o….
Compiling o/act_obj.o….
Compiling o/act_wiz.o….
Compiling o/boards.o….
Compiling o/build.o….
Compiling o/clans.o….
Compiling o/comm.o….
cc1plus: warnings being treated as errors
comm.c:60: warning: overflow in implicit constant conversion
comm.c:60: warning: overflow in implicit constant conversion
comm.c:61: warning: overflow in implicit constant conversion
comm.c:61: warning: overflow in implicit constant conversion
comm.c:62: warning: overflow in implicit constant conversion
comm.c:62: warning: overflow in implicit constant conversion
make[1]: *** [o/comm.o] Error 1
make: *** [all] Error 2
Line 60, 61, and 62 of comm.c =
const char echo_off_str [] = { IAC, WILL, TELOPT_ECHO, '\0' };
const char echo_on_str [] = { IAC, WONT, TELOPT_ECHO, '\0' };
const char go_ahead_str [] = { IAC, GA, '\0' };