This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [hurd,commited] hurd sendmsg: Fix warning on calling CMSG_*HDR
- From: Samuel Thibault <samuel dot thibault at gnu dot org>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: libc-alpha at sourceware dot org, bug-hurd at gnu dot org, commit-hurd at gnu dot org
- Date: Sun, 29 Dec 2019 18:21:34 +0100
- Subject: Re: [hurd,commited] hurd sendmsg: Fix warning on calling CMSG_*HDR
- References: <20191229165108.2856915-1-samuel.thibault@ens-lyon.org> <87imlz83a5.fsf@igel.home>
Andreas Schwab, le dim. 29 déc. 2019 18:12:02 +0100, a ecrit:
> > - for (; cmsg; cmsg = CMSG_NXTHDR (message, cmsg))
> > + for (; cmsg; cmsg = CMSG_NXTHDR ((struct msghdr *) message, cmsg))
>
> Why is the first argument of __cmsg_nxthdr not const?
I don't know, it is so on other systems as well.
I guess an issue is that if it was const, CMSG_NXTHDR would only
be allowed to return a const, and the caller might actually want a
non-const (and it passed a non-const). So it'd be a choice between
cast-parameter vs cast-returned-value.
Samuel