This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14455] roundup macro bug
- From: "pashev.igor at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 07 Mar 2013 19:47:39 +0000
- Subject: [Bug libc/14455] roundup macro bug
- Auto-submitted: auto-generated
- References: <bug-14455-131@http.sourceware.org/bugzilla/>
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.