X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=parser.c;h=38dffce2be24cabf55fb63ab4332335f0909e5c7;hb=f4ccc7ee5551bda618bc55fa511ba43078826cf9;hp=0f2dd11ef9ae7aeff4c283a7ce39244f4efaffd8;hpb=45002a9bc0d85c57215aabd153e8a95825ece7d2;p=cparser diff --git a/parser.c b/parser.c index 0f2dd11..38dffce 100644 --- a/parser.c +++ b/parser.c @@ -4114,7 +4114,7 @@ static declaration_t *internal_record_declaration( 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; @@ -4132,6 +4132,13 @@ static declaration_t *internal_record_declaration( 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) {