diff --git a/tools/qfcc/source/def.c b/tools/qfcc/source/def.c index 82e88c5ae..c0332be60 100644 --- a/tools/qfcc/source/def.c +++ b/tools/qfcc/source/def.c @@ -575,7 +575,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space, internal_error (0, "half defined var"); if (storage == sc_extern) { if (init) - warning (0, "initializing external variable"); + error (0, "initializing external variable"); return; } if (init && check->s.def->initialized) { @@ -611,7 +611,7 @@ initialize_def (symbol_t *sym, expr_t *init, defspace_t *space, init_field_def (sym->s.def, init, storage); if (storage == sc_extern) { if (init) - warning (0, "initializing external variable"); + error (0, "initializing external variable"); return; } if (!init) diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 7ae13bd6e..3fac0f926 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -1021,6 +1021,9 @@ overloaded_identifier non_code_func : '=' '#' expr { + if ($-1.storage == sc_extern) { + error (0, "initializing external variable"); + } build_builtin_function ($0, $3, 0); } | '=' expr