Thanks for global/gtags!

I patched the gtags-parser/Cpp so that it does not record forward
definitions of classes (e.g. "class myClass;"), because in bigger projects
forward definitions may be used very extensively to reduce compile times,
and gtags would report a lot "false-positive" matches.

I have not come across a disadvantage of this. Perhaps it could be
interesting for forward definitions of functions as well.

Anyway, feel free to include the idea in the global sourcetree, if you want.

Regards,
  Tobias Polzin

patch:

-----------------------------------------------------------------------------------------------
diff -c -r1.1.1.2 Cpp.c
*** gtags-parser/Cpp.c  10 Aug 2007 23:18:07 -0000      1.1.1.2
--- gtags-parser/Cpp.c  26 Sep 2007 12:56:17 -0000
***************
*** 190,199 ****
                        DBG_PRINT(level, "class");
                        if ((c = nexttoken(interested, cpp_reserved_word))
== SYMBOL) {
                                strlimcpy(classname, token,
sizeof(classname));
-                               if (target == DEF)
-                                       PUT(token, lineno, sp);
                                if (peekc(0) != ';')
                                        startclass = 1;
                        }
                        break;
                case '{':  /* } */
--- 190,201 ----
                        DBG_PRINT(level, "class");
                        if ((c = nexttoken(interested, cpp_reserved_word))
== SYMBOL) {
                                strlimcpy(classname, token,
sizeof(classname));
                                if (peekc(0) != ';')
+                               {
                                        startclass = 1;
+                                       if (target == DEF)
+                                         PUT(token, lineno, sp);
+                               }
                        }
                        break;
                case '{':  /* } */
-----------------------------------------------------------------------------------------------
_______________________________________________
Bug-global mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-global

Reply via email to