> From: Andy Wingo <[email protected]>
> Cc: [email protected]
> Date: Sat, 23 Jul 2016 22:55:50 +0200
>
> > CC libguile_2.0_la-socket.lo
> > socket.c: In function 'scm_fill_sockaddr':
> > socket.c:747:16: warning: variable 'scope_id' set but not used
> > [-Wunused-but-set-variable]
> > unsigned long scope_id = 0;
> > ^
> >
> > The patch to avoid this warning is below. OK to commit?
>
> I don't think so -- whether the underlying system has scope_id or no, we
> need this assert to happen:
>
> > +#ifdef HAVE_SIN6_SCOPE_ID
> > SCM_VALIDATE_ULONG_COPY (which_arg + 3, SCM_CAR (*args),
> > scope_id);
> > +#endif
>
> Not sure what the right solution is.
How about something this instead:
#ifdef HAVE_SIN6_SCOPE_ID
SCM_VALIDATE_ULONG_COPY (which_arg + 3, SCM_CAR (*args),
scope_id);
#else
(void)SCM_NUM2ULONG (which_arg + 3, SCM_CAR (*args));
#endif