int create_server_socket(...) { int fd, ret; if ((fd = socket(...)) >= 0) { if ((ret = bind(...)) == 0) { if ((ret = listen(...)) == 0) { if ((ret = accept(..)) >= 0) { ... close(fd); return ret; } else { close(fd); return -ERROR_ACCEPT; } } else { close(fd); return -ERROR_LISTEN; } } else { close(fd); return -ERROR_BIND; } } else { return -ERROR_SOCKET; } }
Standard input is empty
prog.c:1:26: error: ISO C requires a named argument before ‘...’
int create_server_socket(...) {
^
prog.c: In function ‘create_server_socket’:
prog.c:3:3: warning: implicit declaration of function ‘socket’ [-Wimplicit-function-declaration]
if ((fd = socket(...)) >= 0) {
^
prog.c:3:20: error: expected expression before ‘...’ token
if ((fd = socket(...)) >= 0) {
^
prog.c:4:5: warning: implicit declaration of function ‘bind’ [-Wimplicit-function-declaration]
if ((ret = bind(...)) == 0) {
^
prog.c:4:21: error: expected expression before ‘...’ token
if ((ret = bind(...)) == 0) {
^
prog.c:5:7: warning: implicit declaration of function ‘listen’ [-Wimplicit-function-declaration]
if ((ret = listen(...)) == 0) {
^
prog.c:5:25: error: expected expression before ‘...’ token
if ((ret = listen(...)) == 0) {
^
prog.c:6:9: warning: implicit declaration of function ‘accept’ [-Wimplicit-function-declaration]
if ((ret = accept(..)) >= 0) {
^
prog.c:6:27: error: expected expression before ‘.’ token
if ((ret = accept(..)) >= 0) {
^
prog.c:7:11: error: expected expression before ‘...’ token
...
^
prog.c:11:11: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
close(fd);
^
prog.c:12:19: error: ‘ERROR_ACCEPT’ undeclared (first use in this function)
return -ERROR_ACCEPT;
^
prog.c:12:19: note: each undeclared identifier is reported only once for each function it appears in
prog.c:16:17: error: ‘ERROR_LISTEN’ undeclared (first use in this function)
return -ERROR_LISTEN;
^
prog.c:20:15: error: ‘ERROR_BIND’ undeclared (first use in this function)
return -ERROR_BIND;
^
prog.c:23:13: error: ‘ERROR_SOCKET’ undeclared (first use in this function)
return -ERROR_SOCKET;
^
prog.c:25:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
Standard output is empty