Closed brooksdavis closed 7 years ago
(I took the original UNCONST
implementation from the original NetBSD headers so didn't question it much.)
But about your change: if the cast should be against uintptr_t
, why does the code say __uintptr_t
? Note that the tests are failing.
__uintptr_t
is define by the compiler and thus is more appropriate for a normal UNCONST
macro in a system header since it has no dependencies. In practice uintptr_t
should be fine and might be more appropriate here.
I see about 30 test failures with and without this change on FreeBSD 10.2. In Travis CI, it looks like there's an explicit exit 2
in the script somewhere which is triggering failures here.
You have to scroll up (before the dump of the config.log
contents) to see the actual build error.
It looks like the previous versions were working due to header pollution on FreeBSD (both clang and gcc5 built without warnings without stdint.h
included).
The C language only guarantees that pointers can be reconstituted after being cast to an integral type if that type if that type is (u)intptr_t.