Sun 05 Dec 2010 11:06:21 AM UTC, original submission:
Summary
=======
.) cflow does not see calls to function inside a function
1) returning a pointer to a struct
2) with arguments declared using old style (Kernighan & Ritchie)
instead of "modern" ANSI C style
Details
=======
System Setup
-----------
On GNU/Linux ubuntu 9.10 karmic
kernel: Linux 2.6.31-22-generic)
architecture: i386
$ uname -a
Linux henri 2.6.31-22-generic #68-Ubuntu SMP Tue Oct 26 16:38:35 UTC 2010 i686 GNU/Linux
cflow version
-------------
ftp://download.gnu.org.ua/pub/release/cflow/cflow-1.3.tar.gz
-----%< cflow-OK.c -------------------------------------------
struct s * foo (int arg)
{
bar();
}
----->% cflow-OK.c -------------------------------------------
-----%< cflow-BUG.c -------------------------------------------
struct s * foo (arg)
int arg;
{
bar();
}
----->% cflow-BUG.c -------------------------------------------
Results
-------
$ cflow --xref cflow-OK.c
bar cflow-OK.c:3
foo * cflow-OK.c:1 struct s foo (int arg)
$ cflow --xref cflow-BUG.c
foo * cflow-BUG.c:1 struct s foo (arg)
The call to bar() DOES NOT SHOW UP
Remarks
-------
you need BOTH
1) old style arguments declaration
2) function returning struct of pointer to a struct
to trigger the bug. otherwhise old style arguments declarations or
functions returning struct or pointer to struct are handled correctly
Even inserting a declaration for bar... and making sure that
"gcc -Wall -ansi -pedantic" accepts the test case does not help:
-----%< cflow-STRICT.c -------------------------------------------
extern struct s * bar(void);
struct s * foo (arg)
int arg;
{
return (bar());
}
----->% cflow-STRICT.c -------------------------------------------
|