int create_server_socket(...) { int ret, fd; fd = socket(...); if (fd < 0) { ret = -ERROR_SOCKET; goto FAIL_RETURN; } ret = bind(...); if (ret < 0) { ret = -ERROR_BIND; goto FAIL_CLOSE_AND_RETURN; } ret = listen(...); if (ret < 0) { ret = -ERROR_LISTEN; goto FAIL_CLOSE_AND_RETURN; } ret = accept(...); if (ret < 0) { ret = -ERROR_ACCEPT; goto FAILE_CLOSE_AND_RETURN; } FAIL_CLOSE_AND_RETURN: close(fd); FAIL_RETURN: return ret; }
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:4:3: warning: implicit declaration of function ‘socket’ [-Wimplicit-function-declaration]
fd = socket(...);
^
prog.c:4:15: error: expected expression before ‘...’ token
fd = socket(...);
^
prog.c:6:12: error: ‘ERROR_SOCKET’ undeclared (first use in this function)
ret = -ERROR_SOCKET;
^
prog.c:6:12: note: each undeclared identifier is reported only once for each function it appears in
prog.c:10:3: warning: implicit declaration of function ‘bind’ [-Wimplicit-function-declaration]
ret = bind(...);
^
prog.c:10:14: error: expected expression before ‘...’ token
ret = bind(...);
^
prog.c:12:12: error: ‘ERROR_BIND’ undeclared (first use in this function)
ret = -ERROR_BIND;
^
prog.c:16:3: warning: implicit declaration of function ‘listen’ [-Wimplicit-function-declaration]
ret = listen(...);
^
prog.c:16:16: error: expected expression before ‘...’ token
ret = listen(...);
^
prog.c:18:12: error: ‘ERROR_LISTEN’ undeclared (first use in this function)
ret = -ERROR_LISTEN;
^
prog.c:22:3: warning: implicit declaration of function ‘accept’ [-Wimplicit-function-declaration]
ret = accept(...);
^
prog.c:22:16: error: expected expression before ‘...’ token
ret = accept(...);
^
prog.c:24:12: error: ‘ERROR_ACCEPT’ undeclared (first use in this function)
ret = -ERROR_ACCEPT;
^
prog.c:29:3: warning: implicit declaration of function ‘close’ [-Wimplicit-function-declaration]
close(fd);
^
prog.c:25:5: error: label ‘FAILE_CLOSE_AND_RETURN’ used but not defined
goto FAILE_CLOSE_AND_RETURN;
^
Standard output is empty