All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: Remove the use of K&R functions
@ 2023-02-16 23:16 Andrew Cooper
  2023-02-17 10:31 ` Anthony PERARD
  2023-02-17 11:10 ` George Dunlap
  0 siblings, 2 replies; 4+ messages in thread
From: Andrew Cooper @ 2023-02-16 23:16 UTC (permalink / raw)
  To: Xen-devel
  Cc: Andrew Cooper, Anthony PERARD, George Dunlap, Jan Beulich,
	Stefano Stabellini, Wei Liu, Julien Grall

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(-)

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;
 
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: Remove the use of K&R functions
  2023-02-16 23:16 [PATCH] tools: Remove the use of K&R functions Andrew Cooper
@ 2023-02-17 10:31 ` Anthony PERARD
  2023-02-17 11:10 ` George Dunlap
  1 sibling, 0 replies; 4+ messages in thread
From: Anthony PERARD @ 2023-02-17 10:31 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Xen-devel, George Dunlap, Jan Beulich, Stefano Stabellini,
	Wei Liu, Julien Grall

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,

-- 
Anthony PERARD


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: Remove the use of K&R functions
  2023-02-16 23:16 [PATCH] tools: Remove the use of K&R functions Andrew Cooper
  2023-02-17 10:31 ` Anthony PERARD
@ 2023-02-17 11:10 ` George Dunlap
  2023-02-17 11:12   ` Andrew Cooper
  1 sibling, 1 reply; 4+ messages in thread
From: George Dunlap @ 2023-02-17 11:10 UTC (permalink / raw)
  To: Andrew Cooper
  Cc: Xen-devel, Anthony PERARD, George Dunlap, Jan Beulich,
	Stefano Stabellini, Wei Liu, Julien Grall

[-- Attachment #1: Type: text/plain, Size: 767 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1219 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tools: Remove the use of K&R functions
  2023-02-17 11:10 ` George Dunlap
@ 2023-02-17 11:12   ` Andrew Cooper
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2023-02-17 11:12 UTC (permalink / raw)
  To: George Dunlap
  Cc: Xen-devel, Anthony PERARD, George Dunlap, Jan Beulich,
	Stefano Stabellini, Wei Liu, Julien Grall

[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2283 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-17 11:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 23:16 [PATCH] tools: Remove the use of K&R functions Andrew Cooper
2023-02-17 10:31 ` Anthony PERARD
2023-02-17 11:10 ` George Dunlap
2023-02-17 11:12   ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.