Commit 00cfeacf authored by Eric Engestrom's avatar Eric Engestrom Committed by Eric Engestrom
Browse files

vk/util: drop no-op compiler warning workaround

`-Wswitch` applies to `switch()`, not `case:`, and is bypassed by the
presence of a `default:` anyway, so let's drop the `default:` and move
the warning suppression to where it can make a difference, and then it
turns out that we don't need to keep a list of special cases anymore :)
Signed-off-by: Eric Engestrom's avatarEric Engestrom <>
Reviewed-by: Lionel Landwerlin's avatarLionel Landwerlin <>
parent 90e7ce5b
Pipeline #38330 canceled with stages
in 6 seconds
......@@ -71,23 +71,16 @@ C_TEMPLATE = Template(textwrap.dedent(u"""\
const char *
vk_${[2:]}_to_str(${} input)
switch(input) {
% for v in sorted(enum.values.keys()):
% if enum.values[v] in FOREIGN_ENUM_VALUES:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch"
% endif
switch(input) {
% for v in sorted(enum.values.keys()):
case ${v}:
return "${enum.values[v]}";
% if enum.values[v] in FOREIGN_ENUM_VALUES:
#pragma GCC diagnostic pop
% endif
% endfor
unreachable("Undefined enum value.");
#pragma GCC diagnostic pop
unreachable("Undefined enum value.");
% if enum.guard:
......@@ -225,12 +218,6 @@ H_TEMPLATE = Template(textwrap.dedent(u"""\
# These enums are defined outside their respective enum blocks, and thus cause
# -Wswitch warnings.
class NamedFactory(object):
"""Factory for creating enums."""
......@@ -433,8 +420,7 @@ def main():
if __name__ == '__main__':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment