summaryrefslogtreecommitdiff
path: root/test/stdint/int-types.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2014-10-15 04:38:39 -0600
committerTom Rini <trini@ti.com>2014-10-27 11:04:01 -0400
commitb01495e644db8315bd32b9e8d324487ef4f5b4f6 (patch)
treea79534c7a2efb8529e23ac4d07a4f5c2722ac116 /test/stdint/int-types.c
parent4fd074de03787ac0f6dfa61da7af230cb76714ff (diff)
test: Add a simple test to detected warnings with uint64_t, uintptr_t
These types are problematic because they are typically declared in a non-standard way in U-Boot. For example, U-Boot uses 'long long' for int64_t even on a 64-bit machine whereas stdint.h uses 'long'. Similarly, U-Boot always uses 'long' for intptr_t whereas stdint.h mostly uses 'int'. This simple test script runs a few toolchains on a few archs to check for warnings. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test/stdint/int-types.c')
-rw-r--r--test/stdint/int-types.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/stdint/int-types.c b/test/stdint/int-types.c
new file mode 100644
index 0000000000..2660084d94
--- /dev/null
+++ b/test/stdint/int-types.c
@@ -0,0 +1,13 @@
+#include <common.h>
+#include <inttypes.h>
+
+int test_types(void)
+{
+ uintptr_t uintptr = 0;
+ uint64_t uint64 = 0;
+ u64 u64_val = 0;
+
+ printf("uintptr = %" PRIuPTR "\n", uintptr);
+ printf("uint64 = %" PRIu64 "\n", uint64);
+ printf("u64 = %" PRIu64 "\n", u64_val);
+}