bug-global
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug in global


From: Shigio YAMAGUCHI
Subject: Re: Bug in global
Date: Wed, 26 Nov 2008 10:08:27 +0900

Hi,
> And here's the source file that is giving us problems, I narrowed it down to
> 2 functions and a #define.  Also, this is a .cpp file.
> 
> file.cpp
> ---------------------
> 
> #define IS_SF_BLOCK(block) (utStrcmp(gmi_type_string((block)),"SF")==0)
> 
> bool BlockIsSF(const slBlock *block) {
>     return(true);
> }
> 
> bool BlockIsChannel(const slBlock *block) {
>     return(true);
> }
> --------------------------------
> 
> 
> If you run gtags, and then "global BlockIsSF", it says that the tag is not
> found.  If I comment out the #define, it finds both functions.

I wrote some code to improve the problem.
Though it is not a correct method, your code can be correctly analyzed.

Thank you for your bug report!

Index: gtags-parser/Cpp.c
===================================================================
RCS file: /sources/global/global/gtags-parser/Cpp.c,v
retrieving revision 1.12
diff -c -r1.12 Cpp.c
*** gtags-parser/Cpp.c  10 Nov 2008 14:13:44 -0000      1.12
--- gtags-parser/Cpp.c  26 Nov 2008 00:52:19 -0000
***************
*** 256,262 ****
                        DBG_PRINT(level, "}");
                        break;
                case '=':
!                       startequal = 1;
                        break;
                case ';':
                        startthrow = startequal = 0;
--- 256,267 ----
                        DBG_PRINT(level, "}");
                        break;
                case '=':
!                       /* dirty hack. Don't mimic this. */
!                       if (peekc(0) == '=') {
!                               throwaway_nextchar();
!                       } else {
!                               startequal = 1;
!                       }
                        break;
                case ';':
                        startthrow = startequal = 0;
Index: libutil/token.c
===================================================================
RCS file: /sources/global/global/libutil/token.c,v
retrieving revision 1.22
diff -c -r1.22 token.c
*** libutil/token.c     26 Oct 2007 04:57:15 -0000      1.22
--- libutil/token.c     26 Nov 2008 00:52:19 -0000
***************
*** 280,285 ****
--- 280,293 ----
        return c;
  }
  /*
+  * throwaway_nextchar: throw away next character
+  */
+ void
+ throwaway_nextchar()
+ {
+       nextchar();
+ }
+ /*
   * atfirst_exceptspace: return if current position is the first column
   *                    except for space.
   *    |      1 0
Index: libutil/token.h
===================================================================
RCS file: /sources/global/global/libutil/token.h,v
retrieving revision 1.14
diff -c -r1.14 token.h
*** libutil/token.h     5 Jul 2007 06:52:05 -0000       1.14
--- libutil/token.h     26 Nov 2008 00:52:19 -0000
***************
*** 53,58 ****
--- 53,59 ----
  int nexttoken(const char *, int (*)(const char *, int));
  void pushbacktoken(void);
  int peekc(int);
+ void throwaway_nextchar();
  int atfirst_exceptspace(void);
  
  #endif /* ! _TOKEN_H_ */
--
Shigio YAMAGUCHI <address@hidden>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

[Prev in Thread] Current Thread [Next in Thread]