This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug network/15347] New: __FD_MASK triggers undefined behavior
- From: "fweimer at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Mon, 08 Apr 2013 13:59:53 +0000
- Subject: [Bug network/15347] New: __FD_MASK triggers undefined behavior
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=15347
Bug #: 15347
Summary: __FD_MASK triggers undefined behavior
Product: glibc
Version: 2.17
Status: NEW
Severity: normal
Priority: P2
Component: network
AssignedTo: fweimer@redhat.com
ReportedBy: fweimer@redhat.com
Classification: Unclassified
typedef long int __fd_mask;
#define __FD_MASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
1 can be shifted into the sign position, which isn't legal C.
I think we should just use 1UL and cast the result of the shift.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.