This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14455] New: roundup macro bug
- From: "mikulas at artax dot karlin.mff.cuni.cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Fri, 10 Aug 2012 23:43:13 +0000
- Subject: [Bug libc/14455] New: roundup macro bug
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14455
Bug #: 14455
Summary: roundup macro bug
Product: glibc
Version: 2.16
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: unassigned@sourceware.org
ReportedBy: mikulas@artax.karlin.mff.cuni.cz
CC: drepper.fsp@gmail.com
Classification: Unclassified
When the first parameter of a roundup macro is a 64-bit number and the second
parameter is unsigned 32-bit number, the macro misbehaves. You should cast the
second parameter to long long or typeof of the first parameter before calling
the
~ operator.
Try this:
#include <stdio.h>
#include <sys/param.h>
int main(void)
{
printf("%llx\n", roundup(0x123456789abcdefLL, 4U));
return 0;
}
--
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.