This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Avoid undefined behavior in __FD_MASK
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Fri, 21 Feb 2014 20:27:56 +0100
- Subject: Re: [PATCH] Avoid undefined behavior in __FD_MASK
- Authentication-results: sourceware.org; auth=none
- References: <51651881 dot 2020906 at redhat dot com> <52F8DAB1 dot 9000809 at redhat dot com>
On Mon, Feb 10, 2014 at 02:57:05PM +0100, Florian Weimer wrote:
> On 04/10/2013 09:45 AM, Florian Weimer wrote:
> >Shifting 1 into the sign position is supported by current GCC versions,
> >but the manual explicitly says this is subject to change. __fd_mask
> >should really be an unsigned type, but changing that is more risky. The
> >remaining bit operations should be safe.
>
> I'd like to revive this patch:
>
> <https://www.sourceware.org/ml/libc-alpha/2013-04/msg00295.html>
>
> Changing the type of __fd_mask requires updates to the ABI
> testsuites. __fd_mask was added to them for a reason, I suppose, so
> I think adding the cast is the right way to address this.
>
> --
> Florian Weimer / Red Hat Product Security Team
I am ok with cast.