static bool debug;
static bool thread;
static bool disable_assert;
- static bool disable_checking;
+ static bool enable_checking;
static bool disable_non_null;
static bool non_null_experimental;
static string cc_command;
{ "debug", 'g', 0, OptionArg.NONE, ref debug, "Produce debug information", null },
{ "thread", 0, 0, OptionArg.NONE, ref thread, "Enable multithreading support", null },
{ "disable-assert", 0, 0, OptionArg.NONE, ref disable_assert, "Disable assertions", null },
- { "disable-checking", 0, 0, OptionArg.NONE, ref disable_checking, "Disable run-time checks", null },
+ { "enable-checking", 0, 0, OptionArg.NONE, ref enable_checking, "Enable additional run-time checks", null },
{ "disable-non-null", 0, 0, OptionArg.NONE, ref disable_non_null, "Disable non-null types", null },
{ "enable-non-null-experimental", 0, 0, OptionArg.NONE, ref non_null_experimental, "Enable experimental enhancements for non-null types", null },
{ "cc", 0, 0, OptionArg.STRING, ref cc_command, "Use COMMAND as C compiler command", "COMMAND" },
context.library = library;
context.assert = !disable_assert;
- context.checking = !disable_checking;
+ context.checking = enable_checking;
context.non_null = !disable_non_null || non_null_experimental;
context.non_null_experimental = non_null_experimental;
Report.set_verbose_errors (!quiet_mode);
public CCodeStatement? create_type_check_statement (CodeNode method_node, DataType ret_type, TypeSymbol t, bool non_null, string var_name) {
var ccheck = new CCodeFunctionCall ();
- if ((t is Class && !((Class) t).is_compact) || t is Interface) {
+ if (context.checking && ((t is Class && !((Class) t).is_compact) || t is Interface)) {
var ctype_check = new CCodeFunctionCall (new CCodeIdentifier (get_type_check_function (t)));
ctype_check.add_argument (new CCodeIdentifier (var_name));