Commit 5de16aad authored by Stefan Behnel's avatar Stefan Behnel

make SwitchTransform always generate a 'default' clause to silence C compiler...

make SwitchTransform always generate a 'default' clause to silence C compiler warnings about unmatched enum values
parent 7666aa46
......@@ -5347,6 +5347,11 @@ class SwitchStatNode(StatNode):
code.putln("default:")
self.else_clause.generate_execution_code(code)
code.putln("break;")
else:
# Always generate a default clause to prevent C compiler warnings
# about unmatched enum values (it was not the user who decided to
# generate the switch statement, so shouldn't be bothered).
code.putln("default: break;")
code.putln("}")
def generate_function_definitions(self, env, code):
......
Markdown is supported
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