const symbol_t *const symbol = declaration->symbol;
const namespace_t namespc = (namespace_t)declaration->namespc;
- assert(declaration->symbol != NULL);
+ assert(symbol != NULL);
declaration_t *previous_declaration = get_declaration(symbol, namespc);
type_t *const orig_type = declaration->type;
check_type_of_main(declaration, &type->function);
}
+ if (warning.nested_externs &&
+ declaration->storage_class == STORAGE_CLASS_EXTERN &&
+ scope != global_scope) {
+ warningf(&declaration->source_position,
+ "nested extern declaration of '%#T'", declaration->type, symbol);
+ }
+
assert(declaration != previous_declaration);
if (previous_declaration != NULL
&& previous_declaration->parent_scope == scope) {