When compiling with clang on Linux, it complains that "passing an
object that undergoes default argument promotion to 'va_start' has
undefined behavior". That is true according to the C standard,
although I couldn't find any mention about enum->int promotion (even
though it's a sensible one). The only fix I came up with was changing
the layer parameter to int so that it does not undergo any default
argument promotion.
Signed-off-by: Martin Kletzander <mkletzan(a)redhat.com>
---
Even though this is a build-breaker, I don't see anyone (or CI)
complaining about it, and the fix doesn't lok that nice, so...
src/util/virfirewall.c | 4 ++--
src/util/virfirewall.h | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/util/virfirewall.c b/src/util/virfirewall.c
index 3f976186a671..da4602aa422b 100644
--- a/src/util/virfirewall.c
+++ b/src/util/virfirewall.c
@@ -417,7 +417,7 @@ virFirewallAddRuleFullV(virFirewallPtr firewall,
*/
virFirewallRulePtr
virFirewallAddRule(virFirewallPtr firewall,
- virFirewallLayer layer,
+ int layer,
...)
{
virFirewallRulePtr rule;
@@ -452,7 +452,7 @@ virFirewallAddRule(virFirewallPtr firewall,
* Returns the new rule
*/
virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall,
- virFirewallLayer layer,
+ int layer,
bool ignoreErrors,
virFirewallQueryCallback cb,
void *opaque,
diff --git a/src/util/virfirewall.h b/src/util/virfirewall.h
index dbf397537fa8..51608b648633 100644
--- a/src/util/virfirewall.h
+++ b/src/util/virfirewall.h
@@ -45,7 +45,7 @@ virFirewallPtr virFirewallNew(void);
void virFirewallFree(virFirewallPtr firewall);
virFirewallRulePtr virFirewallAddRule(virFirewallPtr firewall,
- virFirewallLayer layer,
+ int layer,
...)
ATTRIBUTE_SENTINEL;
@@ -54,7 +54,7 @@ typedef int (*virFirewallQueryCallback)(virFirewallPtr firewall,
void *opaque);
virFirewallRulePtr virFirewallAddRuleFull(virFirewallPtr firewall,
- virFirewallLayer layer,
+ int layer,
bool ignoreErrors,
virFirewallQueryCallback cb,
void *opaque,
--
2.11.0