[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: With a wacky macro before it, 'global' appears to miss a function
From: |
Jean-Marc Saffroy |
Subject: |
Re: With a wacky macro before it, 'global' appears to miss a function |
Date: |
Thu, 28 Apr 2011 09:24:41 +0200 (CEST) |
On Thu, 28 Apr 2011, Shigio YAMAGUCHI wrote:
> > I fully second that. Macros should only be considered on a "best
> > effort" basis.
>
> "best effort" might be making two modes.
>
> When calmly thinking, the issue becomes complex because I try to
> support both ANSI and K&R at the same time.
> I'm thinking about making ANSI mode.
>
> In ANSI mode, it is thought that programs are written only by ANSI style.
> The macro problem below can be solved at least in ANSI mode.
>
> > STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;
> >
> > void test_func(long dummy1, long dummy2)
> > {
>
> The mode is specified by some environment variable.
>
> % gtags <= the same behavior as old times
> % setenv GTAGSANSIC 1
> % gtags <= ANSI C mode
>
> The default mode is left as it is.
> If everyone agrees, the ANSI mode will become new default mode.
> When programs written by K&R disappear from the world,
> I would like to delete old mode.
>
> What do you think?
Consider an old but actively maintained code base such as the binutils
project: most of the code is written as ANSI C, but some pieces of K&R
remain here and there, mixed with ANSI. For example see:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/m32r/sim-if.c?rev=1.13&content-type=text/x-cvsweb-markup&cvsroot=src
So it's probably not a good idea to separate parsing for ANSI and K&R yet.
When will it be then? It could be in a very long time...
Also I have to say I agree with this comment sent earlier:
http://lists.gnu.org/archive/html/bug-global/2011-04/msg00015.html
In support of this comment, I can say it's common that I don't find a
definition with a normal definition search: in this case, a symbol search
works most of the time. Sometimes I do have to use grep (typically when
macros are used to create symbol names from parameters), but it's rather
rare. So for me, the current situation isn't so bad. :)
Cheers,
Jean-Marc
--
address@hidden
- Re: With a wacky macro before it, 'global' appears to miss a function, (continued)
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/24
- Re: With a wacky macro before it, 'global' appears to miss a function, Phillip Ezolt, 2011/04/25
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/26
- Re: With a wacky macro before it, 'global' appears to miss a function, Marc Herbert, 2011/04/27
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/27
- Re: With a wacky macro before it, 'global' appears to miss a function, Ezolt, Phillip, 2011/04/27
- Re: With a wacky macro before it, 'global' appears to miss a function, Marc Herbert, 2011/04/28
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/28
- Re: With a wacky macro before it, 'global' appears to miss a function, Marc Herbert, 2011/04/29
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/29
- Re: With a wacky macro before it, 'global' appears to miss a function,
Jean-Marc Saffroy <=
- Re: With a wacky macro before it, 'global' appears to miss a function, Shigio YAMAGUCHI, 2011/04/28