Skip to contentSkip to conversation

tools/xenstored: Correct the prototype of domain_max_chk()

PATCH In review Julien Grall 3 participants 3 messages Jun 12, 2023

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/xenstored: Correct the prototype of domain_max_chk()

From: Julien Grall <[email protected]>

Some version of GCC will complain because the prototype and the declaration of domain_max_chk() don't match:

xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem, unsigned int)' [-Werror=enum-int-mismatch]
1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,

      |      ^~~~~~~~~~~~~~
In file included from xenstored_domain.c:31:
xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
  146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
      |      ^~~~~~~~~~~~~~

Update the prototype to match the declaration.

This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.

Fixes 685048441e1c ("tools/xenstore: switch quota management to be table based")
---
 tools/xenstore/xenstored_domain.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/xenstore/xenstored_domain.h +1 -1
index bf63f3fcc667..4950b00aee54 100644
@@ -143,7 +143,7 @@ void acc_drop(struct connection *conn);
 void acc_commit(struct connection *conn);
 int domain_max_global_acc(const void *ctx, struct connection *conn);
 void domain_reset_global_acc(void);
-bool domain_max_chk(const struct connection *conn, unsigned int what,
+bool domain_max_chk(const struct connection *conn, enum accitem what,
 		    unsigned int val);
 
 extern long wrl_ntransactions;
Signature · 1 line
2.40.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Julien Grall

From: Julien Grall <[email protected]>

Some version of GCC will complain because the prototype and the declaration of domain_max_chk() don't match:

xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem, unsigned int)' [-Werror=enum-int-mismatch]
1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,

       |      ^~~~~~~~~~~~~~
In file included from xenstored_domain.c:31:
xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
   146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
       |      ^~~~~~~~~~~~~~
Quoted 6 lines

Update the prototype to match the declaration.

This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.

Fixes 685048441e1c ("tools/xenstore: switch quota management to be table based")

Juergen

Reviewed-by Tested-by on v1 1/1
#2 lore raw
In reply to Julien Grall
Quoted 14 lines · Julien Grall

From: Julien Grall <[email protected]>

Some version of GCC will complain because the prototype and the declaration of domain_max_chk() don't match:

xenstored_domain.c:1503:6: error: conflicting types for 'domain_max_chk' due to enum/integer mismatch; have '_Bool(const struct connection *, enum accitem, unsigned int)' [-Werror=enum-int-mismatch]
1503 | bool domain_max_chk(const struct connection *conn, enum accitem what,

      |      ^~~~~~~~~~~~~~
In file included from xenstored_domain.c:31:
xenstored_domain.h:146:6: note: previous declaration of 'domain_max_chk' with type '_Bool(const struct connection *, unsigned int,  unsigned int)'
  146 | bool domain_max_chk(const struct connection *conn, unsigned int what,
      |      ^~~~~~~~~~~~~~
Quoted 6 lines

Update the prototype to match the declaration.

This was spotted by Gitlab CI with the job opensuse-tumbleweed-gcc.

Fixes 685048441e1c ("tools/xenstore: switch quota management to be table based")

This fixes the issue on Fedora 38, too.

Thanks,
Jason