can pcpp read defines inside ifdefs and apply them to the following defines?
I tried pccp on the following file:
#ifdef A
#define B 1
#ifdef B
#define C 1
#endif
#endif
with the following arguments and result:
$ pcpp --compress --passthru-defines --passthru-unknown-exprs --passthru-unfound-includes --passthru-comments --line-directive -- test.h
#ifdef A
#define B 1
#ifdef B
#define C 1
#endif
#endif
However I think it should be possible to get the following simpler output instead:
#ifdef A
#define B 1
#define C 1
#endif
Where #ifdef B can be removed, because we know B is obviously defined.
Of course in a real file, nobody would define a variable in one line and test for it in the next, but it can happen with includes and over longer distances, or through redefinition of a define with a different name. So I think this is a simple test case for the more complex scenarios.
Hi! I'm using pcpp 1.30,
can pcpp read defines inside ifdefs and apply them to the following defines?
I tried pccp on the following file:
with the following arguments and result:
However I think it should be possible to get the following simpler output instead:
Where
#ifdef B
can be removed, because we know B is obviously defined.Of course in a real file, nobody would define a variable in one line and test for it in the next, but it can happen with includes and over longer distances, or through redefinition of a define with a different name. So I think this is a simple test case for the more complex scenarios.