[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 01/16] lib/tests: Pass int to va_arg instead of char.
From: |
W. J. van der Laan |
Subject: |
[PATCH 01/16] lib/tests: Pass int to va_arg instead of char. |
Date: |
Sat, 24 Apr 2021 14:18:44 +0000 |
* lib/tests/scaffold/70-stdarg.c (stdarg1, stdarg2, stdarg3): Pass int
to va_arg instead of char to avoid gcc trap "warning: 'char’ is promoted
to ‘int’ when passed through ‘...’ [enabled by default] (so you should
pass ‘int’ not ‘char’ to ‘va_arg’) if this code is reached, the program
will abort".
---
lib/tests/scaffold/70-stdarg.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lib/tests/scaffold/70-stdarg.c b/lib/tests/scaffold/70-stdarg.c
index
307577218de242af2bfbc4a46f6e5f7e1bb19a19..bf8ec1d2985d8de7eace9cf04a4be0261ec1f96a
100644
--- a/lib/tests/scaffold/70-stdarg.c
+++ b/lib/tests/scaffold/70-stdarg.c
@@ -35,7 +35,7 @@ stdarg1 (long *one, ...)
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
#undef __FUNCTION_ARGS
#endif
- c = va_arg (ap, char);
+ c = va_arg (ap, int);
r = c;
eputs ("c:");
eputs (itoa (c));
@@ -59,7 +59,7 @@ stdarg2 (long *one, long *two, ...)
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
#undef __FUNCTION_ARGS
#endif
- c = va_arg (ap, char);
+ c = va_arg (ap, int);
r = c;
eputs ("c:");
eputs (itoa (c));
@@ -83,7 +83,7 @@ stdarg3 (long *one, long *two, long *three, ...)
ap += (__FOO_VARARGS + (__FUNCTION_ARGS << 1)) << 3;
#undef __FUNCTION_ARGS
#endif
- c = va_arg (ap, char);
+ c = va_arg (ap, int);
r = c;
eputs ("c:");
eputs (itoa (c));
--
2.27.0
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 01/16] lib/tests: Pass int to va_arg instead of char.,
W. J. van der Laan <=