options_set(opts_warn, WARN_VARIADIC_FUNCTION, true);
options_set(opts_warn, WARN_FRAME_MACROS, true);
options_set(opts_warn, WARN_UNUSED_VARIABLE, true);
+ options_set(opts_warn, WARN_EFFECTLESS_STATEMENT, true);
if (!options_parse(argc, argv)) {
return usage();
if (!exp)
return false;
*out = exp;
+ if (!ast_istype(exp, ast_store) &&
+ !ast_istype(exp, ast_call) &&
+ !ast_istype(exp, ast_binstore))
+ {
+ if (parsewarning(parser, WARN_EFFECTLESS_STATEMENT, "statement has no effect"))
+ return false;
+ }
return true;
}
}
GMQCC_DEFINE_FLAG(IMPLICIT_FUNCTION_POINTER)
GMQCC_DEFINE_FLAG(VARIADIC_FUNCTION)
GMQCC_DEFINE_FLAG(FRAME_MACROS)
+GMQCC_DEFINE_FLAG(EFFECTLESS_STATEMENT)