On Mon, Jan 04, 2021 at 01:42:48PM +0100, Theo Buehler wrote:
> > > +         return log_sockaddr(addr2sa(addr, 0, &len), len);
> > 
> > Perhaps I haven't yet had enough coffee this year, but I'm unsure
> > whether it is actually guaranteed that addr2sa() is called before the
> > second len in this line is passed to log_sockaddr().
> 
> Answering my own question: C99 and C11 6.5.2.2.12 require that all side
> effects must be completed before log_sockaddr() is called. As addr2sa()
> changes the second len as a side effect, this should be fine.

This doesn't mean that the len in the second arg is evaluated after
the addr2sa call.  The args will be fully evaluated before calling
log_sockaddr, but the order of evaluation is unspecified.

Kris Katterjohn

Reply via email to