diff mbox series

tools: Remove the use of K&R functions

Message ID 20230216231636.714006-1-andrew.cooper3@citrix.com (mailing list archive)
State New, archived
Headers show
Series tools: Remove the use of K&R functions | expand

Commit Message

Andrew Cooper Feb. 16, 2023, 11:16 p.m. UTC
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

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 <andrew.cooper3@citrix.com>
---
CC: Anthony PERARD <anthony.perard@citrix.com>
CC: George Dunlap <George.Dunlap@eu.citrix.com>
CC: Jan Beulich <JBeulich@suse.com>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Wei Liu <wl@xen.org>
CC: Julien Grall <julien@xen.org>
---
 tools/debugger/gdbsx/xg/xg_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Anthony PERARD Feb. 17, 2023, 10:31 a.m. UTC | #1
On Thu, Feb 16, 2023 at 11:16:36PM +0000, Andrew Cooper 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()
>          ^
>           void
> 
> 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 <andrew.cooper3@citrix.com>

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Thanks,
George Dunlap Feb. 17, 2023, 11:10 a.m. UTC | #2
On Thu, Feb 16, 2023 at 11:16 PM Andrew Cooper <andrew.cooper3@citrix.com>
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()
>          ^
>           void
>
> 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.
>

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
Andrew Cooper Feb. 17, 2023, 11:12 a.m. UTC | #3
On 17/02/2023 11:10 am, George Dunlap wrote:
>
>
> On Thu, Feb 16, 2023 at 11:16 PM Andrew Cooper
> <andrew.cooper3@citrix.com> 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()
>              ^
>               void
>
>     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.
>
>
> 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
diff mbox series

Patch

diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index 4576c762af0c..580fe237b20e 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -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;