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] roundup macro bug


http://sourceware.org/bugzilla/show_bug.cgi?id=14455

Igor Pashev <pashev.igor at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pashev.igor at gmail dot
                   |                            |com

--- Comment #1 from Igor Pashev <pashev.igor at gmail dot com> 2013-03-07 19:47:39 UTC ---
(In reply to comment #0)
> 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;
> }

Probably, both args must be of the same width [1]

[1] https://blogs.oracle.com/jwadams/entry/macros_and_powers_of_two

-- 
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]