'Do I have to consider preprocessor directives in a control flow graph?

Do I have to consider preprocessor directives when converting a C-code into a control flow graph?

For example:

#define pi 3.14

From my perspective, there is no need to treat them as commands since they aren't processed during runtime.



Solution 1:[1]

As explained here and as you said it yourself, preprocessor doesn't change runtime. Each instruction is executed before your program is compiled, therefore you don't need to consider them in your graph since each preprocessor instruction will be a constant at runtime.

You could make an exception for macros, though, because it defines some behavior that could be used during the runtime, like functions.

Solution 2:[2]

What matters for a control-flow graph is the output of the preprocessor. If one performs something like #define woozle(x,y,z) (x() ? y() : z()), and then later uses woozle(f1,f2,f3) then when drawing a control-flow graph one should treat it as one would (f1() ? f2() : f3()), without regard for how that combination of tokens came to be represented in the preprocessor's output.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 The Coding Penguin
Solution 2 supercat