switch (global->vtype)
{
+ case TYPE_VOID:
+ if (!strcmp(global->name, "end_sys_globals")) {
+ /* TODO: remember this point... all the defs before this one
+ * should be checksummed and added to progdefs.h when we generate it.
+ */
+ }
+ else if (!strcmp(global->name, "end_sys_globals")) {
+ /* TODO: same as above but for entity-fields rather than globsl
+ */
+ }
+ else
+ irwarning(global->context, WARN_VOID_VARIABLES, "unrecognized variable of type void `%s`",
+ global->name);
+ /* I'd argue setting it to 0 is sufficient, but maybe some depend on knowing how far
+ * the system fields actually go? Though the engine knows this anyway...
+ * Maybe this could be an -foption
+ */
+ ir_value_code_setaddr(global, def.offset);
+ /* Add the def */
+ if (code_defs_add(def) < 0)
+ return false;
+ return true;
case TYPE_POINTER:
if (code_defs_add(def) < 0)
return false;
options_set(opts_warn, WARN_MISSING_RETURN_VALUES, true);
options_set(opts_warn, WARN_USED_UNINITIALIZED, true);
options_set(opts_warn, WARN_LOCAL_CONSTANTS, true);
+ options_set(opts_warn, WARN_VOID_VARIABLE, true);
if (!options_parse(argc, argv)) {
return usage();
GMQCC_DEFINE_FLAG(TOO_FEW_PARAMETERS)
GMQCC_DEFINE_FLAG(LOCAL_SHADOWS)
GMQCC_DEFINE_FLAG(LOCAL_CONSTANTS)
+GMQCC_DEFINE_FLAG(VOID_VARIABLES)