Discussion:
gtags doesn't index function definitions preceded by a macro resembling a function call
Mihai Olteanu
2017-09-22 08:36:09 UTC
Permalink
Hello,

I'm using gtags 6.5.4 for a C project. Some of the function names are in
the following format:*FUNC(void, MY_CODE) My_Function*(void) {
...
}

where FUNC is a macro defined as
*#define FUNC(rettype, memclass) rettype*
*
*
The global command doesn't find *My_Function *but only a lot of *FUNC*s.So gtags is seeing *FUNC* as a function name and adds that to the list
of tags and not *My_Function*.Is there a way to maybe ignore the FUNC macro or maybe expanding the
macro before searching for tags or some similar methods?
Mihai
Shigio YAMAGUCHI
2017-09-22 22:15:15 UTC
Permalink
Hello,
Post by Mihai Olteanu
Is there a way to maybe ignore the FUNC macro or maybe
expanding the macro before searching for tags or some
similar methods?
Would you please make '.notfunction' file in the project
root directory? Gtags does not regard the symbols listed
there as definitions.

[.notfunction]
+-------------------
|FUNC
+-------------------

$ vi .notfunction
$ gtags

Since this is not written in the online manual,
I am going to add a description about it.

Regards,
Shigio
Post by Mihai Olteanu
Hello,
I'm using gtags 6.5.4 for a C project. Some of the function names are in
*FUNC(void, MY_CODE) My_Function*(void) {
...
}
where FUNC is a macro defined as
*#define FUNC(rettype, memclass) rettype*
The global command doesn't find *My_Function *but only a lot of *FUNC*s.
So gtags is seeing *FUNC* as a function name and adds that to the list of
tags and not *My_Function*.
Is there a way to maybe ignore the FUNC macro or maybe expanding the macro
before searching for tags or some similar methods?
Mihai
_______________________________________________
Help-global mailing list
https://lists.gnu.org/mailman/listinfo/help-global
--
Shigio YAMAGUCHI <***@gnu.org>
PGP fingerprint:
26F6 31B4 3D62 4A92 7E6F 1C33 969C 3BE3 89DD A6EB
Loading...