This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14455] New: roundup macro bug


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]