This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/16458] endian.h macros return integers of wrong type
- From: "neleai at seznam dot cz" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Thu, 16 Jan 2014 15:09:16 +0000
- Subject: [Bug libc/16458] endian.h macros return integers of wrong type
- Auto-submitted: auto-generated
- References: <bug-16458-131 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=16458
Ondrej Bilka <neleai at seznam dot cz> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution|--- |INVALID
--- Comment #3 from Ondrej Bilka <neleai at seznam dot cz> ---
> The manpage also explicitly says these are functions, not macros. And if these
> were functions, they would in fact return values of the correct type,
> regardless of the argument and parameter type, which is what the developer
> expects in C. The only constraint being that "each argument shall have a type
> such that its value may be assigned to an object with the unqualified version
> of the type of its corresponding parameter" (i.e. ISO/IEC 9899:1999 6.5.2.2
> Function calls
You are wrong here, A example that you supplied is invalid and you get same
warning with ordinary functions. Closing.
#include <stdint.h>
uint64_t foo(uint64_t bar)
{
return bar;
}
int main() {
const long int i = 42;
const uint64_t b = foo(i);
return (int) b;
}
--
You are receiving this mail because:
You are on the CC list for the bug.