Skip to content

Instantly share code, notes, and snippets.

@jonm
Last active October 10, 2015 19:50
Show Gist options
  • Save jonm/0b413c2b2fdb152d4909 to your computer and use it in GitHub Desktop.
Save jonm/0b413c2b2fdb152d4909 to your computer and use it in GitHub Desktop.
missing a cast for the `bind` call
[~/src/SillyMUD/src]$ make
gcc -g -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -Werror -DIMPL_SECURITY -DNEW_RENT -DLEVEL_LOSS -DNEWEXP -DGROUP_NAMES -c -o comm.o comm.c
comm.c:755:14: error: incompatible pointer types passing 'struct sockaddr_in *'
to parameter of type 'const struct sockaddr *'
[-Werror,-Wincompatible-pointer-types]
if (bind(s, &sa, sizeof(sa)) < 0) {
^~~
/usr/include/sys/socket.h:557:38: note: passing argument to parameter here
int bind(int, const struct sockaddr *, socklen_t) __DARWIN_ALIAS(bind);
^
...
9 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