This is going to sound dumb, but what order does the C preprocessor execute tasks in? (First includes, then defines etc)
This sounds dumb, but when the C preprocessor executes tasks as it reads source code, what order does it process the tasks in -- for example, does it handle include files first, then defines, then macros etc?
I know it all gets done eventually, but it would seem the order defines what is seen. If defines are done first and includes are inside a define, then they never get read. If I were building my own preprocessor, what order should I execute steps in:
- Include files
- Convert everything except quoted strings to lower case
- Strip comments
- Do defines/not-defines
Or is this really my fault for putting to many "compiler tasks" into the pre-processor? Is the correct answer "Don't make the pre-processor do anything other than includes and defines"