utils.c:442: warning: array subscript has type `char'
utils.c:442: warning: array subscript has type `char'
// returns a name as a UID, or -1 if it does not translate
int name_as_uid(const char *name) {
if(name == NULL)
return NOBODY;
int i = 0, uid = NOBODY;
for(; name[i] != '\0'; i++)
if(!isdigit(name[i]))
return NOBODY;
sscanf(name, "%d", &uid);
return uid;
}
#include <stdio.h>
typedef long bitvector_t;
typedef unsigned char bool;
#define IS_SET(flag,bit) ((flag) & (bit))
#define SET_BIT(var,bit) ((var) |= (bit))
#define FIND_SCOPE_VISIBLE (1 << 18)
int foo(bool must_see) {
if (must_see)
return 1;
return 0;
}
int main() {
bitvector_t bv = 0;
SET_BIT(bv,FIND_SCOPE_VISIBLE);
printf("%d\n",foo(IS_SET(bv,FIND_SCOPE_VISIBLE)));
return 0;
}
Index: scripts/module.mk
===================================================================
— scripts/module.mk (revision 81)
+++ scripts/module.mk (working copy)
@@ -122,7 +122,7 @@
PYTHONTOP = /usr/include
# the folder where python headers are located
-C_FLAGS += -I$(PYTHONTOP)/python2.4
+C_FLAGS += -I$(PYTHONTOP)/python2.5 -Wno-char-subscripts
# libraries we have to include.
-LIBS += -Xlinker -export-dynamic -lm -ldl -lutil -L/usr/lib/python2.4/config -lpython2.4
+LIBS += -lm -ldl -lutil -L/usr/lib/python2.5/config -lpython2.5
Index: wrapsock.h
===================================================================
— wrapsock.h (revision 81)
+++ wrapsock.h (working copy)
@@ -45,14 +45,6 @@
/*#include <limits.h> normally included by socket*/
/*#include <sys/time.h> timeval normally included by types */
-/* Extern globals */
-/* Used by geopt to check the options supplied by the user */
-extern char *optarg; /* option argument */
-extern int optind; /* index of the next argument on return */
-extern int optopt; /* last known option on return */
-extern int opterr; /* error on return */
-extern int optreset; /* not used here */
-
/* Defines */
/* defined before the right type get a chance to be defined */
#ifndef socklen_t
Index: gameloop.c
===================================================================
— gameloop.c (revision 81)
+++ gameloop.c (working copy)
@@ -399,7 +399,7 @@
/* check for new connections */
if (FD_ISSET(control, &rFd)) {
struct sockaddr_in sock;
- unsigned int socksize;
+ socklen_t socksize;
int newConnection;
socksize = sizeof(sock);
I wanted to take a stab at playing around with NakedMud, and followed these instructions: http://www.nakedmud.org/trac/wiki/Cygwin...
On compiling, I'm getting an absolute ton of warnings. The mud still compiles and runs fine anyways, but I'm a little nervous about leaving warnings alone, so was hoping someone could point me in the right direction as to why they are popping up.
The first is this… it shows up a load, in all but a few of the files:
Then there is this one:
Any enlightenment out there? Perhaps a newb such as myself should start with a different codebase? :D