parrot/parrot — Issue #232: config/auto/sizes/test_c.in uses wrong format specifier to print sizes
Author: gerdr
Created: 2011-12-19 15:30:07+00:00
State: open

*config/auto/sizes/test_c.in* uses the specifier `%u` to print values of type `size_t`, which is not portable and in particular should fail on 64-bit big-endian architectures.

As the correct specifier `%zu` is a C99 addition, it's probably best to convert the value to `unsigned`:

diff --git a/config/auto/sizes/test_c.in b/config/auto/sizes/test_c.in
index a6bd08a..7236d24 100644
--- a/config/auto/sizes/test_c.in
+++ b/config/auto/sizes/test_c.in
@@ -10,7 +10,7 @@ figure out some Configure settings
int
main(int argc, char **argv)
{
- printf("%u\n", sizeof (@TEMP_type@));
+ printf("%u\n", (unsigned)sizeof (@TEMP_type@));
return EXIT_SUCCESS;
}