Menu

#5 provide list of symbols that are undefined

v6.0
open
nobody
None
5
2014-11-29
2014-11-25
No

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.

Related

help: #5

Discussion

  • Mike Kinghan

    Mike Kinghan - 2014-11-29

    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 reported insoluble, because unconfigured. There are other possible reasons for a symbol being reported insoluble: 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 message insoluble, because unconfigured

    Mike

     
    • Jacob Keller

      Jacob Keller - 2014-12-01

      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:

      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 reported
      insoluble, because unconfigured. There are other possible reasons for
      a symbol being reported insoluble: 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 message insoluble, because
      unconfigured

      Mike


      [help:#5] provide list of symbols that are undefined

      Status: open
      Group: v6.0
      Created: Tue Nov 25, 2014 10:14 PM UTC by Jacob Keller
      Last Updated: Tue Nov 25, 2014 10:14 PM UTC
      Owner: nobody

      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.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/coan2/help/5/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      help: #5


Log in to post a comment.