tools: Remove the use of K&R functions
PATCH 1/1 tools: Remove the use of K&R functions
Clang-15 (as seen in the FreeBSD 14 tests) complains:
xg_main.c:1248 error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] xg_init()
^
voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
---
CC: Anthony PERARD <[email protected]>
CC: George Dunlap <[email protected]>
CC: Jan Beulich <[email protected]>
CC: Stefano Stabellini <[email protected]>
CC: Wei Liu <[email protected]>
CC: Julien Grall <[email protected]>
--- tools/debugger/gdbsx/xg/xg_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/xg/xg_main.c +1 -1
@@ -121,7 +121,7 @@ xgprt(const char *fn, const char *fmt, ...)* -1 failure, errno set. */ int -xg_init () +xg_init (void ) {int flags, saved_errno;
Signature · 1 line
2.30.2
Quoted 8 lines · Andrew Cooper
Clang-15 (as seen in the FreeBSD 14 tests) complains:
xg_main.c:1248 error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
xg_init()^ void
Quoted 7 lines
The error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
Signed-off-by Andrew Cooper <[email protected]>
Thanks,
Signature · 1 line
Anthony PERARD
Quoted 6 lines · Andrew Cooper
Clang-15 (as seen in the FreeBSD 14 tests) complains:
xg_main.c:1248 error: a function declaration without a prototype is deprecated in all versions of C
[-Werror,-Wstrict-prototypes]
xg_init()
Quoted 9 lines
^ voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally removes K&R syntax.
Either way, fix the offending functions.
Nit: This says "functions" (plural), but I only see one function being modified in this patch?
Doesn't matter too much but might save an archaeologist some confusion if someone were to fix this up on check-in. :-)
-George
Quoted 19 lines · George Dunlap
On Thu, Feb 16, 2023 at 11:16 PM Andrew Cooper
<[email protected]> wrote:Clang-15 (as seen in the FreeBSD 14 tests) complains:
xg_main.c:1248 error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
xg_init()
^
voidThe error message is a bit confusing but appears to new as part of -Wdeprecated-non-prototype which is part of supporting C2x which formally
removes K&R syntax.
Quoted 8 lines
Either way, fix the offending functions.
Nit: This says "functions" (plural), but I only see one function being modified in this patch?
Doesn't matter too much but might save an archaeologist some confusion if someone were to fix this up on check-in. :-)
Yeah, I pre-emptively wrote the commit message as tools-wide. Given 4 in Xen, I was expecting to find more than 1 in tools.
I fixed it up on commit.
~Andrew