From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29893 invoked by alias); 8 Apr 2013 13:59:59 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 29844 invoked by uid 48); 8 Apr 2013 13:59:53 -0000 From: "fweimer at redhat dot com" To: glibc-bugs@sourceware.org Subject: [Bug network/15347] New: __FD_MASK triggers undefined behavior Date: Mon, 08 Apr 2013 13:59:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: network X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: fweimer at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: fweimer at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 X-SW-Source: 2013-04/txt/msg00060.txt.bz2 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.