Coan ifdef removal tool is incorrectly removing #define of a symbol used in some #ifdef statements

41 Views Asked by At

Using the 6.0.1 version and verified this is a problem back to v5.1.1 at least.

There's a symbol BLOCK_SIZE that is referenced in both header and .c/.cpp files in ifdef statements, where it is generally defined in the beginning of the .c/.cpp file. Using the -DBLOCK_SIZE=16 causing ifdef statements to properly be evaluated and stripped or not, as expected, but unfortunately, it is stripping out the #define BLOCK_SIZE 16.

Tried using both the cmd line -D and using the -fargfile with the symbols in the input file. Tried just this one evaluation (no other symbols) and it seems to always happen.

Reference: https://coan2.sourceforge.net/coan_man_1.html

Because coan does not walk thru include files, it is necessary to supply -D symbols for those definitions that are found in the header that are used by ifdefs. I really can't think of why it would be stripping out the #define in any circumstances. Any ideas? Thanks.

0

There are 0 best solutions below