WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

Index C function prototypes

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

Index C function prototypes

by Tavs :: Rate this Message:

| View Threaded | Show Only this Message

OS: Fedora Core 15 64 bit intel

Global version: global - GNU GLOBAL 5.9.3 (global-5.9.3-3.fc15.x86_64.rpm)

Goal: Say I have a C header file (*.h file) with some function prototypes. I want gtags to index such prototypes, but I can't actually get that to work

What I did:

$ mkdir foo && cd foo/
$ vi foo.h
$ gtags
$ global -vf foo.h


where foo.h contains
#ifndef FOO_H_
#define FOO_H_

void foo() ;

#endif /*FOO_H_*/

What I got
FOO_H_ 2 foo.h ...

What I expected
FOO_H_ 2 foo.h ...
foo   4 foo .h ...

It only works when I write a function definition, i.e. if I substitue the prototype with

void foo () {}

,even if I set GTAGSFORCECPP

What's missing?

TIA

Andrea Taverna

_______________________________________________
Help-global mailing list
Help-global@...
https://lists.gnu.org/mailman/listinfo/help-global

Re: Index C function prototypes

by Shigio YAMAGUCHI-2 :: Rate this Message:

| View Threaded | Show Only this Message

Hi,
> What I got
> FOO_H_ 2 foo.h ...
>
> What I expected
> FOO_H_ 2 foo.h ...
> foo   4 foo .h ...

You can see the tag using the following command line:

$ global -xs foo

As ctags does so, global's parser also considers that a prototype is not a definition.

> It only works when I write a function definition, i.e. if I substitue the
> prototype with
>
> void foo () {}
>
> ,even if I set GTAGSFORCECPP
>
> What's missing?
--
Shigio YAMAGUCHI <shigio@...>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

_______________________________________________
Help-global mailing list
Help-global@...
https://lists.gnu.org/mailman/listinfo/help-global