Skip to content

Complex #if expressions in C files having loops #41

@sonnguyenvnu

Description

@sonnguyenvnu

Hello,

I have used TypeChef to generate call graphs of C program files containing Ifdef (option --dumpcfg). In cases of C files having loops (like the attached C file), the #if expressions might be very complex. One of these complex expressions generated by TypeChef in the attached file (there are some longer expressions, you can see the C file's generated cfg):

#if (definedEx(CONFIG_PPC_64K_PAGES) && definedEx(CONFIG_LOCKDEP) && (!definedEx(CONFIG_PPC_16K_PAGES) || definedEx(CONFIG_PPC_256K_PAGES) || definedEx(CONFIG_PPC_64K_PAGES)) && !definedEx(CONFIG_PPC_256K_PAGES) && (definedEx(CONFIG_PPC_16K_PAGES) || definedEx(CONFIG_PPC_256K_PAGES) || definedEx(CONFIG_PPC_64K_PAGES)) && (!definedEx(CONFIG_LOCKDEP) || !definedEx(CONFIG_PPC_256K_PAGES)))

I think it is possible to simplify these expressions, and you might consider this feature.

Thanks,
Son
complex_if_expressions.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions