Today, I use a wrapper perl script written around unifdef, which is given a list of symbol names. I then use unifdef's -s feature to search for symbols, and then compare this to the inputted list of symbols. Doing this, I am able to then determine any symbols which are in the code but which I didn't specify.
This process is used to vet code so that we don't accidentally include any CPP symbols that we are unaware of. (either by typo, or by early release).
I looked at using "coan symbols" for similar behavior. What would be the best way to obtain a listing of all symbols for which there is no definition. I'd like to do a minimal amount of post-processing on coan's output.
I think it is:
coan symbols -i -L -e -DSYMBOL1 -DSYMBOL2 .. sourcefile
Which I can then search for the line insoluable, and print only those symbols which are not currently defineable.
There does not seem to be an option to only display insoluable symbols, however and thus I require post-processing the output of coan.
I assume what you really want is not a list of symbols that are undefined by the specified configuration but a list of symbols that are unconfigured (not defined and not undefined) by the specified configuration. That is a valuable filter. I'm amazed I didn't think of it in the last 9 years. I 'll implement that in the next release, v7.0. Thanks for the idea!
Until then, the
symbols
command you have quoted would be the next best thing. That will try to give you the expansions of symbols that occur in #if-conditions under the specified configuration with their file/line locations, and any that are unconfigured will be reportedinsoluble, because unconfigured
. There are other possible reasons for a symbol being reportedinsoluble
: a) an infinite regress is detected in the expansion, b) the expansion gets too big for coan's limits. So strictly you want to parse for the messageinsoluble, because unconfigured
Mike
Yes you are indeed correct. :) List of symbols that are unconfigured.
I think I can get by with the symbols with a regular expression to
search for insoluable because unconfigured.
Thanks,
Jake
On Sat, 2014-11-29 at 12:16 +0000, Mike Kinghan wrote:
Related
help: #5