public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Interesting failures of 'cscope'
@ 2004-08-04 23:22 Carl Spalletta
  2004-08-04 23:39 ` Martin J. Bligh
  0 siblings, 1 reply; 3+ messages in thread
From: Carl Spalletta @ 2004-08-04 23:22 UTC (permalink / raw)
  To: lkml

FYI

  The first failure seems to be a confusion between function declarations and definitions - 
eg for linux-2.6.7, it says FsmNew() is called by drivers/isdn/hisax/fsm.h::CallcNew, thus:

$cscope -d -p9 -L -3 FsmNew
  ...
  drivers/isdn/hisax/fsm.h CallcNew 50 int FsmNew(struct Fsm *fsm, struct FsmNode,*fnlist, int
fncount);
  ...

  but there is no call there, only an external declaration of FsmNew, and no declaration of
CallcNew of any kind whatsoever in that file!


  The second failure appears to be related to an inability to cope with complicated declarations
within a prototype, such of those of type pointer-to-function. For example, the definition:

  struct net_device *alloc_netdev(int sizeof_priv, const char *mask, 
                                         void (*setup)(struct net_device *))

from line 73 of drivers/net/net_init.c, is not recognized by cscope as a valid function definition
and so it does not find the call to kmalloc (or anything else) contained in that function.

$ cscope -d -p9 -L -1 alloc_netdev
<nothing>
$ cscope -d -p9 -L -3 kmalloc | grep alloc_netdev
<nothing>



^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: Interesting failures of 'cscope'
@ 2004-08-04 23:37 Carl Spalletta
  0 siblings, 0 replies; 3+ messages in thread
From: Carl Spalletta @ 2004-08-04 23:37 UTC (permalink / raw)
  To: lkml

The previous posting related to false negatives obtained by 'cscope'. This posting relates
to false positives from the same cause (can't parse pointer-to-function declarations):

>From arch/i386/kernel/irq.c:

    621 int request_irq(unsigned int irq,
    622                 irqreturn_t (*handler)(int, void *, struct pt_regs *),
    623                 unsigned long irqflags,
    624                 const char * devname,
    625                 void *dev_id)

$ /usr/bin/cscope -d -p9 -L -3 setup_irq
...
arch/i386/kernel/irq.c irqreturn_t 660 retval = setup_irq(irq, action);
...

There is obviously no function called 'irqreturn_t'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-08-04 23:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-04 23:22 Interesting failures of 'cscope' Carl Spalletta
2004-08-04 23:39 ` Martin J. Bligh
  -- strict thread matches above, loose matches on Subject: below --
2004-08-04 23:37 Carl Spalletta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox