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: Florian Weimer <fw at deneb dot enyo dot de>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Samuel Thibault <samuel dot thibault at ens-lyon dot org>, libc-alpha at sourceware dot org, bug-hurd at gnu dot org, commit-hurd at gnu dot org
- Date: Sun, 29 Dec 2019 19:48:40 +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:
> On Dez 29 2019, Samuel Thibault wrote:
>
>> diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
>> index 0c19b3223c..3d7317cec4 100644
>> --- a/sysdeps/mach/hurd/sendmsg.c
>> +++ b/sysdeps/mach/hurd/sendmsg.c
>> @@ -108,7 +108,7 @@ __libc_sendmsg (int fd, const struct msghdr
>> *message, int flags)
>>
>> /* Allocate enough room for ports. */
>> cmsg = CMSG_FIRSTHDR (message);
>> - 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?
Some programmers expect that CMSG_NXTHDR can be used to construct
ancillary data. See bug 13500.