Last active
October 3, 2015 19:47
-
-
Save jonm/f72402d88ed72c39312b to your computer and use it in GitHub Desktop.
initial compilation errors
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ make | |
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c | |
In file included from comm.c:21: | |
./protos.h:21:7: error: conflicting types for 'strdup' | |
char *strdup(char *source); | |
^ | |
/usr/include/string.h:117:7: note: previous declaration is here | |
char *strdup(const char *); | |
^ | |
comm.c:133:7: warning: implicitly declaring library function 'log' with type | |
'double (double)' | |
log("Lawful mode selected."); | |
^ | |
comm.c:133:7: note: please include the header <math.h> or explicitly provide a | |
declaration for 'log' | |
comm.c:133:11: error: passing 'char [22]' to parameter of incompatible type | |
'double' | |
log("Lawful mode selected."); | |
^~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:141:6: error: passing 'char [40]' to parameter of incompatible type | |
'double' | |
log("Directory arg expected after option -d."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:147:11: error: passing 'char [44]' to parameter of incompatible type | |
'double' | |
log("Suppressing assignment of special routines."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:152:11: error: passing 'char [512]' to parameter of incompatible type | |
'double' | |
log(buf); | |
^~~ | |
comm.c:163:25: warning: implicit declaration of function 'atoi' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
} else if ((port = atoi(argv[pos])) <= 1024) { | |
^ | |
comm.c:163:8: warning: add explicit braces to avoid dangling else | |
[-Wdangling-else] | |
} else if ((port = atoi(argv[pos])) <= 1024) { | |
^ | |
comm.c:171:7: error: passing 'char [512]' to parameter of incompatible type | |
'double' | |
log(buf); | |
^~~ | |
comm.c:173:7: warning: implicit declaration of function 'chdir' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
if (chdir(dir) < 0) { | |
^ | |
comm.c:179:7: error: passing 'char [512]' to parameter of incompatible type | |
'double' | |
log(buf); | |
^~~ | |
comm.c:181:3: warning: implicit declaration of function 'srandom' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
srandom(time(0)); | |
^ | |
comm.c:202:3: warning: implicit declaration of function 'close' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
close(0); | |
^ | |
comm.c:226:7: error: passing 'char [17]' to parameter of incompatible type | |
'double' | |
log("Signal trapping."); | |
^~~~~~~~~~~~~~~~~~ | |
comm.c:229:7: error: passing 'char [27]' to parameter of incompatible type | |
'double' | |
log("Opening mother connection."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:234:11: error: passing 'char [33]' to parameter of incompatible type | |
'double' | |
log("System load too high at startup."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:240:7: error: passing 'char [20]' to parameter of incompatible type | |
'double' | |
log("Entering game loop."); | |
^~~~~~~~~~~~~~~~~~~~~ | |
comm.c:249:9: error: passing 'char [11]' to parameter of incompatible type | |
'double' | |
log("Rebooting."); | |
^~~~~~~~~~~~ | |
comm.c:253:7: error: passing 'char [28]' to parameter of incompatible type | |
'double' | |
log("Normal termination of game."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:291:17: warning: implicit declaration of function 'getdtablesize' is | |
invalid in C99 [-Wimplicit-function-declaration] | |
avail_descs = getdtablesize() -2; | |
^ | |
comm.c:434:4: warning: add explicit braces to avoid dangling else | |
[-Wdangling-else] | |
else | |
^ | |
comm.c:447:4: warning: add explicit braces to avoid dangling else | |
[-Wdangling-else] | |
else { | |
^ | |
comm.c:615:2: warning: implicit declaration of function 'free' is invalid in C99 | |
[-Wimplicit-function-declaration] | |
free(tmp->text); | |
^ | |
comm.c:630:9: error: passing 'char [37]' to parameter of incompatible type | |
'double' | |
log("Output message to non-existant queue"); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:634:3: warning: implicitly declaring library function 'calloc' with type | |
'void *(unsigned long, unsigned long)' | |
CREATE(new, struct txt_block, 1); | |
^ | |
./utils.h:33:28: note: expanded from macro 'CREATE' | |
if (!((result) = (type *) calloc ((number), sizeof(type))))\ | |
^ | |
comm.c:634:3: note: please include the header <stdlib.h> or explicitly provide a | |
declaration for 'calloc' | |
./utils.h:33:28: note: expanded from macro 'CREATE' | |
if (!((result) = (type *) calloc ((number), sizeof(type))))\ | |
^ | |
comm.c:634:3: warning: implicitly declaring library function 'abort' with type | |
'void (void) __attribute__((noreturn))' | |
CREATE(new, struct txt_block, 1); | |
^ | |
./utils.h:34:31: note: expanded from macro 'CREATE' | |
{ perror("malloc failure"); abort(); }\ | |
^ | |
comm.c:634:3: note: please include the header <stdlib.h> or explicitly provide a | |
declaration for 'abort' | |
./utils.h:34:31: note: expanded from macro 'CREATE' | |
{ perror("malloc failure"); abort(); }\ | |
^ | |
comm.c:637:9: error: passing 'char [43]' to parameter of incompatible type | |
'double' | |
log("strlen returned bogus length in write_to_q"); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:721:2: warning: implicit declaration of function 'gethostname' is invalid | |
in C99 [-Wimplicit-function-declaration] | |
gethostname(hostname, MAX_HOSTNAME); | |
^ | |
comm.c:737:3: warning: implicitly declaring library function 'exit' with type | |
'void (int) __attribute__((noreturn))' | |
exit (1); | |
^ | |
comm.c:737:3: note: please include the header <stdlib.h> or explicitly provide a | |
declaration for 'exit' | |
comm.c:747:31: error: too many arguments to function call, expected 3, have 4 | |
if (bind(s, &sa, sizeof(sa), 0) < 0) { | |
~~~~ ^ | |
/usr/include/sys/socket.h:557:1: note: 'bind' declared here | |
int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind); | |
^ | |
comm.c:771:8: error: macro names must be identifiers | |
#ifdef 0 | |
^ | |
comm.c:775:47: warning: passing 'int *' to parameter of type 'socklen_t *' | |
(aka 'unsigned int *') converts between pointers to integer types with | |
different sign [-Wpointer-sign] | |
if ((t = accept(s, (struct sockaddr *)&isa, &i)) < 0){ | |
^~ | |
/usr/include/sys/socket.h:555:69: note: passing argument to parameter here | |
int accept(int, struct sockaddr * __restrict, socklen_t * __restrict) | |
^ | |
comm.c:815:25: warning: implicit declaration of function 'inet_ntoa' is invalid | |
in C99 [-Wimplicit-function-declaration] | |
strcpy(buf, (char *)inet_ntoa(addr)); | |
^ | |
/usr/include/secure/_string.h:83:33: note: expanded from macro 'strcpy' | |
__builtin___strcpy_chk (dest, src, __darwin_obsz (dest)) | |
^ | |
comm.c:815:17: warning: cast to 'char *' from smaller integer type 'int' | |
[-Wint-to-pointer-cast] | |
strcpy(buf, (char *)inet_ntoa(addr)); | |
^ | |
/usr/include/secure/_string.h:83:33: note: expanded from macro 'strcpy' | |
__builtin___strcpy_chk (dest, src, __darwin_obsz (dest)) | |
^ | |
comm.c:874:52: warning: passing 'int *' to parameter of type 'socklen_t *' | |
(aka 'unsigned int *') converts between pointers to integer types with | |
different sign [-Wpointer-sign] | |
if (getpeername(desc, (struct sockaddr *) &sock, &size) < 0) { | |
^~~~~ | |
/usr/include/sys/socket.h:559:74: note: passing argument to parameter here | |
int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict) | |
^ | |
comm.c:881:36: warning: incompatible integer to pointer conversion passing 'int' | |
to parameter of type 'const char *' [-Wint-conversion] | |
if ((long) strncpy(newd->host, inet_ntoa(sock.sin_addr), 49) > 0) { | |
^~~~~~~~~~~~~~~~~~~~~~~~ | |
/usr/include/secure/_string.h:119:34: note: expanded from macro 'strncpy' | |
__builtin___strncpy_chk (dest, src, len, __darwin_obsz (dest)) | |
^ | |
comm.c:960:19: warning: implicit declaration of function 'write' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
thisround = write(desc, txt + sofar, total - sofar); | |
^ | |
comm.c:990:22: warning: implicit declaration of function 'read' is invalid in | |
C99 [-Wimplicit-function-declaration] | |
if ((thisround = read(t->descriptor, t->buf + begin + sofar, | |
^ | |
comm.c:1002:6: error: passing 'char [32]' to parameter of incompatible type | |
'double' | |
log("EOF encountered on socket read."); | |
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
comm.c:1083:7: error: passing 'char [21]' to parameter of incompatible type | |
'double' | |
log("Closing all sockets."); | |
^~~~~~~~~~~~~~~~~~~~~~ | |
fatal error: too many errors emitted, stopping now [-ferror-limit=] | |
21 warnings and 20 errors generated. | |
make: *** [comm.o] Error 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment