diff options
| author | 2026-03-23 11:35:54 +0100 | |
|---|---|---|
| committer | 2026-03-23 11:35:54 +0100 | |
| commit | c1267dbfeb153c782e9690de8962aaf176ed0cdd (patch) | |
| tree | ba176734c64945a33747ea95e52505f869799132 /test/11-abi.c | |
| parent | b9d12248e4c3e698ab35f8f264443d5a4b48be1a (diff) | |
tests: don't rely on unportable %p output
Diffstat (limited to 'test/11-abi.c')
| -rw-r--r-- | test/11-abi.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/11-abi.c b/test/11-abi.c index 895b3ba..fcda498 100644 --- a/test/11-abi.c +++ b/test/11-abi.c @@ -1,11 +1,12 @@ /* EXPECT: -1 2 3 4 5 6 (nil) 9 abcdef +1 2 3 4 5 6 0x0 9 abcdef : 10, 20 1.000000 2.000000 3.000000 {4.000000,5.000000} -0.000000(80000000h) 99.000000 : -1.000000 */ #include <stdio.h> +#include <inttypes.h> struct l { short s[10]; }; struct x { long p; }; @@ -13,8 +14,9 @@ struct ll { long a, b; }; struct ll f(int a, int b, struct l c, int d, int e, int f, void *g, struct x x, char *s) { printf("%d %d %d %d ", a, b, c.s[0], d); - printf("%d %d %p %ld %s\n", e, f, g, x.p, s); - return (struct ll){10,20}; + printf("%d %d 0x%"PRIxPTR" %ld %s\n", e, f, (intptr_t)g, x.p, s); + return (struct ll){10,20 + }; } struct f2 { float f[2]; }; |