appleseedlab / maki

A tool for analyzing syntactic and semantic properties of C Preprocessor macros in C programs
8 stars 3 forks source link

`DoesSubexpressionExpandedFromBodyHaveTypeDefinedAfterMacro` does not account for type names #30

Closed PappasBrent closed 2 months ago

PappasBrent commented 2 months ago

Maki reports whether a macro expansion contains a subexpression which has a type that is defined after the invocation's corresponding macro definition, but Maki does not check if a macro expansion contains the name of a type that is defined after the expanded macro's definition.

For instance, for the following snippet:

#define FOO() sizeof(ID)

typedef enum ID { A, B, C } ID;

int main(void) {
        FOO();
        return 0;
}

Maki would DoesSubexpressionExpandedFromBodyHaveTypeDefinedAfterMacro as being false, when it should be true.