bug-cflow
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-cflow] unfortunate behavior when no main() or --main=nonexistant_fu


From: Britton Kerin
Subject: [bug-cflow] unfortunate behavior when no main() or --main=nonexistant_function
Date: Sat, 30 Apr 2016 15:53:16 -0800

It seems that without main(), cflow is in a different mode and somehow does a
better job of digging out all the information about all the functions.  For a
program I'm working on, with main() some functions are mentioned as callees but
don't get a signature and the functions they call aren't mentioned.

Without main(), the same function gets a full top-level entry of it's own
complete with signature and callee subtree.  The only unfortunate thing is that
the first mention of the function shows it as a callee without a signature or a
reference to the later line containing the signature and callee subtree.

I think this situation arises in my case because the function name is
constructed by the preprocessor and only called by pointer stored in a global,
so it's too much for cflow to figure out (though I like cflow's approach of
treating a function pointer reference as a call from the function containing
that reference).  So it's a bit weird but the fact that this situation exists
shows that it might be useful to support a --complete mode (or whatever you
want to call it) that outputs all call trees, not only those reachable from
the chosen main().  Alternately, the trick of using --main=nonexistant_func
could be described in the manual.

Also, it would be good if either:

  * the first mention of a function was always the full description (i.e. the
    one containing the signature and callee subtree), or

  * references worked in both directions.  At the moment it seems that mentions
    which come before the full description of the function don't get a line
    number reference to the full description.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]