variables are definition if they are not extern
authorMatthias Braun <matthias.braun@kit.edu>
Thu, 10 May 2012 18:35:12 +0000 (20:35 +0200)
committerMatthias Braun <matthias.braun@kit.edu>
Thu, 10 May 2012 18:35:12 +0000 (20:35 +0200)
ast2firm.c

index eb490e5..1bdc49f 100644 (file)
@@ -858,7 +858,7 @@ static bool declaration_is_definition(const entity_t *entity)
 {
        switch (entity->kind) {
        case ENTITY_VARIABLE:
-               return entity->variable.initializer != NULL;
+               return entity->declaration.storage_class != STORAGE_CLASS_EXTERN;
        case ENTITY_FUNCTION:
                return entity->function.statement != NULL;
        case ENTITY_PARAMETER: