bugGNU cflow - Bugs: bug #31792, function calls inside functions:...


bug #31792: function calls inside functions: 1) returning struct * + 2) old style arguments declaration

Submitter:  None
Submitted:  Sun 05 Dec 2010 11:06:21 AM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  gray
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup

Fri 07 Feb 2014 02:27:19 PM UTC, comment #1: 

Fixed by commit 0f28750f.

Sergey Poznyakoff <gray>
Group administrator
Sun 05 Dec 2010 11:06:21 AM UTC, original submission:  

.) 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


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

-----%< cflow-OK.c -------------------------------------------
struct s * foo (int arg)
----->% cflow-OK.c -------------------------------------------

-----%< cflow-BUG.c -------------------------------------------
struct s * foo (arg)
     int arg;
----->% cflow-BUG.c -------------------------------------------

$ 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

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 -------------------------------------------



(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by gray (Posted a comment)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-02-07 gray StatusNone Fixed
        Assigned toNone gray
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code