static function calls not being produced unless explicitly called

View: New views
3 Messages — Rating Filter:   Alert me  

static function calls not being produced unless explicitly called

by Josiah Carlson (NIM) :: Rate this Message:

| View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Good day,

 

I have recently started using cflow, and I have noticed that it doesn’t produce static definition results in the call graph unless they are explicitly called by a non-static function.  For example…

 

When running the following source through cflow via ‘cflow test.c’…

 

static long

foo(void) {

    return 0;

}

 

int

main(char** argc, int argv) {

    /* uncomment the following and foo is now output */

    /* foo(); */

    return 1;

}

 

I get the following…

 

main() <int main (char **argc,int argv) at test.c:8>:

 

But when I uncomment the foo call, I get…

 

main() <int main (char **argc,int argv) at test.c:8>:

    foo() <long foo (void) at test.c:3>

 

Personally, I want to see all static functions in the output.  I have worked around it by temporarily removing the static portion of the declaration, but not having to do such a thing (to a few dozen files) would be nice.  If this is intended behavior, then I suppose I will live with it.

 

Thank you,

 - Josiah Carlson

 


_______________________________________________
bug-cflow mailing list
bug-cflow@...
http://lists.gnu.org/mailman/listinfo/bug-cflow

Re: static function calls not being produced unless explicitly called

by Sergey Poznyakoff :: Rate this Message:

| View Threaded | Show Only this Message

Josiah Carlson (NIM) <jcarlson@...> ha escrit:

> I have recently started using cflow, and I have noticed that it doesn't
> produce static definition results in the call graph unless they are
> explicitly called by a non-static function.

It does not list any function (be it static or global), unless its
invocation can be traced up to main function (either `main' or whatever
given with the `--main' command line option).

> Personally, I want to see all static functions in the output.  I have
> worked around it by temporarily removing the static portion of the
> declaration,

Removing the static qualifier in your example does not change anything
(if it does, then it is a bug). The only thing that matters is whether
`foo' is called from `main' or not.

Regards,
Sergey


_______________________________________________
bug-cflow mailing list
bug-cflow@...
http://lists.gnu.org/mailman/listinfo/bug-cflow

RE: static function calls not being produced unless explicitly called

by Josiah Carlson (NIM) :: Rate this Message:

| View Threaded | Show Only this Message


Sergey wrote:
> Josiah Carlson (NIM) <jcarlson@...> ha escrit:
> > I have recently started using cflow, and I have noticed that it
doesn't
> > produce static definition results in the call graph unless they are
> > explicitly called by a non-static function.
>
> It does not list any function (be it static or global), unless its
> invocation can be traced up to main function (either `main' or
whatever
> given with the `--main' command line option).
>
> > Personally, I want to see all static functions in the output.  I
have
> > worked around it by temporarily removing the static portion of the
> > declaration,
>
> Removing the static qualifier in your example does not change anything
> (if it does, then it is a bug). The only thing that matters is whether
> `foo' is called from `main' or not.

Running variants of the example I sent previously does not seem to show
the behavior I am experiencing when running it on a group of 20 or so
.c/.h files.

Though by your description of cflow's behavior, I shouldn't be seeing
any output, as none of the source files I am running cflow on have any
main function (they are all Python extension modules), nor have I been
passing anything with --main (unless something magical happens when you
do something like 'cflow *.[ch]' ).

I guess to get the behavior I desire I will have to change cflow to suit
my needs.  Thank you for your help Sergey,

 - Josiah



_______________________________________________
bug-cflow mailing list
bug-cflow@...
http://lists.gnu.org/mailman/listinfo/bug-cflow