bug-global
[Top][All Lists]
Advanced

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

Re: [PATCH] skip type qualifiers which continues after typedef


From: Shigio Yamaguchi
Subject: Re: [PATCH] skip type qualifiers which continues after typedef
Date: Wed, 19 Mar 2003 17:16:18 +0900

Committed. Thank you.

> This patch is dependent on patch in http://mail.gnu.org/archive/html/bug-glob
al/2003-03/msg00006.html
> 
> >cat t.c
> typedef const struct {
>         int             foo;
>         double          bar;
> } ZOO;
> 
> [current cvs version]
> >gctags -dtw t.c
> foo                 2 t.c               int             foo;
> Warning: missing left '{' [+4 t.c].
> 
> [patched version]
> >gctags -dtw t.c
> ZOO                 4 t.c              } ZOO;
> 
> 
> 
> diff -ur -x CVS ../../global_org/global/gctags/C.c gctags/C.c
> --- ../../global_org/global/gctags/C.c        Fri Mar  7 21:22:33 2003
> +++ gctags/C.c        Fri Mar  7 21:23:31 2003
> @@ -310,7 +310,12 @@
>                               int     typedef_savelevel = level;
>  
>                               savetok[0] = 0;
> -                             c = nexttoken("{}(),;", reserved);
> +
> +                             /* skip type qualifiers */
> +                             do {
> +                                     c = nexttoken("{}(),;", reserved);
> +                             } while (IS_TYPE_QUALIFIER(c));
> +
>                               if (wflag && c == EOF) {
>                                       fprintf(stderr, "Warning: unexpected eo
f. [+%d %s]\n", lineno, curfile);
>                                       break;
> Only in gctags: C.c.orig
> diff -ur -x CVS ../../global_org/global/gctags/C.h gctags/C.h
> --- ../../global_org/global/gctags/C.h        Fri Mar  7 21:22:33 2003
> +++ gctags/C.h        Fri Mar  7 01:46:39 2003
> @@ -101,3 +101,5 @@
>  #define IS_CTOKEN(c) ((c) > CTOKEN_BASE && (c) < CTOKEN_BASE + 1000)
>  #define IS_CPTOKEN(c)        ((c) > CPTOKEN_BASE && (c) < CPTOKEN_BASE + 100
0)
>  #define IS_YACCTOKEN(c)      ((c) > YACCTOKEN_BASE && (c) < YACCTOKEN_BASE +
 1000)
> +
> +#define IS_TYPE_QUALIFIER(c) ((c) == C_CONST || (c) == C_RESTRICT || (c) == 
C_VOLATILE)
> 
> ----
> Hideki IWAMOTO  address@hidden
> 
> 
> _______________________________________________
> Bug-global mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-global
> 
> 
--
Shigio Yamaguchi <address@hidden> - Tama Communications Corporation
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3




reply via email to

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