1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2026-05-22 10:15:16 +02:00

Remove -Wswitch-enum compiler option.

The -Wswitch option included in -Wall provides the same level of coverage and allows enum options to be grouped into default.
This commit is contained in:
David Steele
2019-05-15 12:55:08 -04:00
parent 53f6232264
commit 5bba72b874
5 changed files with 15 additions and 24 deletions
+4
View File
@@ -163,6 +163,10 @@
<p>Improve coverage in <file>perl/exec</file>, <file>config/config</file>, and <file>config/parse</file> modules.</p>
</release-item>
<release-item>
<p>Remove <id>-Wswitch-enum</id> compiler option.</p>
</release-item>
<release-item>
<p>Error on multiple option alternate names and simplify help command.</p>
</release-item>
+8 -21
View File
@@ -256,8 +256,7 @@ varEq(const Variant *this1, const Variant *this2)
break;
}
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to test equality for %s", variantTypeName[this1->type]);
}
}
@@ -382,9 +381,7 @@ varBoolForce(const Variant *this)
result = varUInt64(this) != 0;
break;
case varTypeDouble:
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeBool]);
}
@@ -484,8 +481,7 @@ varDblForce(const Variant *this)
break;
}
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeDouble]);
}
@@ -603,9 +599,7 @@ varIntForce(const Variant *this)
break;
}
case varTypeDouble:
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeInt]);
}
@@ -711,9 +705,7 @@ varInt64Force(const Variant *this)
break;
}
case varTypeDouble:
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeInt64]);
}
@@ -840,9 +832,7 @@ varUIntForce(const Variant *this)
break;
}
case varTypeDouble:
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeUInt]);
}
@@ -958,9 +948,7 @@ varUInt64Force(const Variant *this)
break;
}
case varTypeDouble:
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(AssertError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeUInt64]);
}
@@ -1137,8 +1125,7 @@ varStrForce(const Variant *this)
break;
}
case varTypeKeyValue:
case varTypeVariantList:
default:
THROW_FMT(FormatError, "unable to force %s to %s", variantTypeName[this->type], variantTypeName[varTypeString]);
}
+1 -1
View File
@@ -2799,7 +2799,7 @@ fi
CWARNING=$warning
else
CWARNING="$warning -Wwrite-strings -Wswitch-enum -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla"
CWARNING="$warning -Wwrite-strings -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla"
fi
+1 -1
View File
@@ -27,7 +27,7 @@ then
AC_SUBST(CWARNING, $warning)
else
AC_SUBST(CWARNING, "$warning -Wwrite-strings -Wswitch-enum -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla")
AC_SUBST(CWARNING, "$warning -Wwrite-strings -Wconversion -Wformat=2 -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla")
fi
# Set includes
+1 -1
View File
@@ -393,7 +393,7 @@ sub run
# Determine which warnings are available
my $strWarningFlags =
'-Werror -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wswitch-enum -Wconversion -Wformat=2' .
'-Werror -Wfatal-errors -Wall -Wextra -Wwrite-strings -Wconversion -Wformat=2' .
' -Wformat-nonliteral -Wstrict-prototypes -Wpointer-arith -Wvla' .
($self->{oTest}->{&TEST_VM} eq VM_U16 || $self->{oTest}->{&TEST_VM} eq VM_U18 ?
' -Wformat-signedness' : '') .