From MAILER-DAEMON Mon Apr 04 13:56:48 2011
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Q6o1A-0005fF-Ha
	for mharc-bug-global@gnu.org; Mon, 04 Apr 2011 13:56:48 -0400
Received: from [140.186.70.92] (port=52200 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q6nyH-0002HC-OI
	for bug-global@gnu.org; Mon, 04 Apr 2011 13:53:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iain.woolf@alcatel-lucent.com>) id 1Q6nyG-0004vu-7F
	for bug-global@gnu.org; Mon, 04 Apr 2011 13:53:49 -0400
Received: from ihemail3.lucent.com ([135.245.0.37]:58351)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iain.woolf@alcatel-lucent.com>)
	id 1Q6nyG-0004vF-3H; Mon, 04 Apr 2011 13:53:48 -0400
Received: from usnavsmail3.ndc.alcatel-lucent.com
	(usnavsmail3.ndc.alcatel-lucent.com [135.3.39.11])
	by ihemail3.lucent.com (8.13.8/IER-o) with ESMTP id p34HrioF028004
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 4 Apr 2011 12:53:44 -0500 (CDT)
Received: from USNAVSXCHHUB03.ndc.alcatel-lucent.com
	(usnavsxchhub03.ndc.alcatel-lucent.com [135.3.39.112])
	by usnavsmail3.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id
	p34HrhbM021057
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT);
	Mon, 4 Apr 2011 12:53:44 -0500
Received: from [138.120.145.81] (135.3.63.243) by
	USNAVSXCHHUB03.ndc.alcatel-lucent.com (135.3.39.112) with Microsoft
	SMTP Server (TLS) id 8.3.106.1; Mon, 4 Apr 2011 12:53:43 -0500
Message-ID: <4D9A05A3.10304@alcatel-lucent.com>
Date: Mon, 4 Apr 2011 13:53:39 -0400
From: Iain Woolf <iain.woolf@alcatel-lucent.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8
MIME-Version: 1.0
To: Shigio YAMAGUCHI <shigio@gnu.org>
References: <4D9090A5.2010402@alcatel-lucent.com>
	<201103291307.p2TD7F8g004901@tamacom.com>
In-Reply-To: <201103291307.p2TD7F8g004901@tamacom.com>
X-Enigmail-Version: 1.1.1
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.57 on 135.245.2.37
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.11
X-detected-operating-system: by eggs.gnu.org: Solaris 9
X-Received-From: 135.245.0.37
X-Mailman-Approved-At: Mon, 04 Apr 2011 13:56:46 -0400
Cc: "bug-global@gnu.org" <bug-global@gnu.org>
Subject: Re: C++ scoping of cross-reference?
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Apr 2011 17:53:50 -0000

On 03/29/2011 09:07 AM, Shigio YAMAGUCHI wrote:
>> Thanks Shigio. I would like to suggest that global/gtags be extended to
>> support this functionality. Would that be possible?
> What specification are you thinking?
> --
> Shigio YAMAGUCHI <shigio@gnu.org>

I was thinking something along the lines of the class-qualified tag like
in exuberant c-tags (--extra=+q).

>From the ctags man page:

       --extra=[+|-]flags
            Specifies whether to include extra tag entries for certain
kinds of information. The parameter flags is a set  of  one-letter 
flags,  each
            representing one kind of extra tag entry to include in the
tag file. If flags is preceded by by either the '+' or '-' character,
the effect
            of each flag is added to, or removed from, those currently
enabled; otherwise the flags replace any current settings. The meaning 
of  each
            flag is as follows:

               f   Include an entry for the base file name of every
source file (e.g.  "example.c"), which addresses the first line of the file.

               q   Include  an  extra  class-qualified tag entry for
each tag which is a member of a class (for languages for which this
information is
                   extracted; currently C++, Eiffel, and Java). The
actual form of the qualified tag depends upon the language from which
the  tag  was
                   derived  (using  a  form  that  is  most  natural for
how qualified calls are specified in the language). For C++, it is in
the form
                   "class::member"; for Eiffel and Java, it is in the
form "class.member". This may allow easier location of a specific tags
when  mul-
                   tiple  occurrances  of a tag name occur in the tag
file. Note, however, that this could potentially more than double the
size of the
                   tag file.

This would provide class-qualifier definitions. When searching for a
definition, I would like to be able to optionally specify the class
qualifier. For example, consider:

class A
{
public:
  virtual void dump();
};

class B1 : public A
{
public:
  virtual void dump();
}

class B2 : public B
{
public:
  virtual void dump();
}

class C : public A
{
public:
  virtual void dump();
}

If searching with "global -a dump" I would expect to see all of A::dump,
B1::dump, B2::dump, C::dump in the output. Alternatively, it should be
possible to search for "global -a B2::dump".

Hopefully this could be extended to include references to class specific
methods, e.g. "global -r B2::dump". However I realize that determining
these kinds of references would likely be a lot harder.

What do you think?

-- 
Iain Woolf              W-CDMA Base Software, Alcatel-Lucent
Tel: 613-784-3465 / OnNET 2-825-3465
IM: iwoolf (im.ca.alcatel-lucent.com) / i_woolf (YahooIM)



From MAILER-DAEMON Mon Apr 04 21:38:42 2011
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Q6vE9-000193-Cm
	for mharc-bug-global@gnu.org; Mon, 04 Apr 2011 21:38:41 -0400
Received: from [140.186.70.92] (port=34954 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q6vE3-0000rA-0y
	for bug-global@gnu.org; Mon, 04 Apr 2011 21:38:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1Q6vDx-0001XP-As
	for bug-global@gnu.org; Mon, 04 Apr 2011 21:38:30 -0400
Received: from msa102lp.auone-net.jp ([222.3.140.165]:56334)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1Q6vDw-0001Vs-PH; Mon, 04 Apr 2011 21:38:29 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa102lp.auone-net.jp (au one net msa) with ESMTP id 7B45A668031;
	Tue,  5 Apr 2011 10:38:22 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p351cMuL001969;
	Tue, 5 Apr 2011 10:38:22 +0900 (JST)
Message-Id: <201104050138.p351cMuL001969@tamacom.com>
To: Iain Woolf <iain.woolf@alcatel-lucent.com>
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <4D9A05A3.10304@alcatel-lucent.com>
In-reply-to: Message from Iain Woolf <iain.woolf@alcatel-lucent.com> of "Mon,
	04 Apr 2011 13:53:39 -0400." <4D9A05A3.10304@alcatel-lucent.com>
Date: Tue, 05 Apr 2011 10:38:22 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.165
Cc: "bug-global@gnu.org" <bug-global@gnu.org>
Subject: Re: C++ scoping of cross-reference?
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2011 01:38:38 -0000

> I was thinking something along the lines of the class-qualified tag like
> in exuberant c-tags (--extra=+q).
>
> From the ctags man page:
>
>       --extra=[+|-]flags

If possible, could you describe only your proposal?

> This would provide class-qualifier definitions. When searching for a
> definition, I would like to be able to optionally specify the class
> qualifier. For example, consider:
> 
> class A
> {
> public:
>   virtual void dump();
> };
> 
> class B1 : public A
> {
> public:
>   virtual void dump();
> }
> 
> class B2 : public B
> {
> public:
>   virtual void dump();
> }
> 
> class C : public A
> {
> public:
>   virtual void dump();
> }
> 
> If searching with "global -a dump" I would expect to see all of A::dump,
> B1::dump, B2::dump, C::dump in the output. Alternatively, it should be
> possible to search for "global -a B2::dump".

What is the -a option? What occurs without it?

You mean the following behavior?

[Class hierarchy]

	class A
	  |- class B
	       |- class C

[Source files]

	[classA.cc]
	+--------------------------------
	|...
	|class A { void dump() {...}}

	[classB.cc]
	+--------------------------------
	|...
	|class B : A { void dump() {...}}

	[classC.cc]
	+--------------------------------
	|...
	|class C : B { void dump() {...}}

[Execution image]

	$ global -x A::dump
	A::dump		classA.cc	 50 class A { void dump() {...} }
	B::dump		classB.cc	100 class B : A { void dump() {...} }
	C::dump		classC.cc	 90 class C : B { void dump() {...} }
	$ _

	$ global -x B::dump
	B::dump		classB.cc	100 class B : A { void dump() {...} }
	C::dump		classC.cc	 90 class C : B { void dump() {...} }
	$ _

	$ global -x C::dump
	C::dump		classC.cc	 90 class C : B { void dump() {...} }
	$ _

> Hopefully this could be extended to include references to class specific
> methods, e.g. "global -r B2::dump". However I realize that determining
> these kinds of references would likely be a lot harder.

Would you please describe it for example?
Why do you think it is a lot harder?
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Tue Apr 05 21:04:50 2011
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Q7HAv-0006DC-Tm
	for mharc-bug-global@gnu.org; Tue, 05 Apr 2011 21:04:49 -0400
Received: from [140.186.70.92] (port=45351 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q79lt-0006gX-Uy
	for bug-global@gnu.org; Tue, 05 Apr 2011 13:10:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <iain.woolf@alcatel-lucent.com>) id 1Q79ll-0001VE-2q
	for bug-global@gnu.org; Tue, 05 Apr 2011 13:10:29 -0400
Received: from ihemail3.lucent.com ([135.245.0.37]:35771)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <iain.woolf@alcatel-lucent.com>)
	id 1Q79lk-0001Ut-Ur; Tue, 05 Apr 2011 13:10:21 -0400
Received: from usnavsmail4.ndc.alcatel-lucent.com
	(usnavsmail4.ndc.alcatel-lucent.com [135.3.39.12])
	by ihemail3.lucent.com (8.13.8/IER-o) with ESMTP id p35HAKj9017737
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 5 Apr 2011 12:10:20 -0500 (CDT)
Received: from USNAVSXCHHUB03.ndc.alcatel-lucent.com
	(usnavsxchhub03.ndc.alcatel-lucent.com [135.3.39.112])
	by usnavsmail4.ndc.alcatel-lucent.com (8.14.3/8.14.3/GMO) with ESMTP id
	p35HAJtB021758
	(version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NOT);
	Tue, 5 Apr 2011 12:10:20 -0500
Received: from [138.120.145.81] (135.3.63.243) by
	USNAVSXCHHUB03.ndc.alcatel-lucent.com (135.3.39.112) with Microsoft
	SMTP Server (TLS) id 8.3.106.1; Tue, 5 Apr 2011 12:10:19 -0500
Message-ID: <4D9B4CF3.1040808@alcatel-lucent.com>
Date: Tue, 5 Apr 2011 13:10:11 -0400
From: Iain Woolf <iain.woolf@alcatel-lucent.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.2.14) Gecko/20110223 Lightning/1.0b2 Thunderbird/3.1.8
MIME-Version: 1.0
To: Shigio YAMAGUCHI <shigio@gnu.org>
References: <4D9A05A3.10304@alcatel-lucent.com>
	<201104050138.p351cMuL001969@tamacom.com>
In-Reply-To: <201104050138.p351cMuL001969@tamacom.com>
X-Enigmail-Version: 1.1.1
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
X-Scanned-By: MIMEDefang 2.57 on 135.245.2.37
X-Scanned-By: MIMEDefang 2.64 on 135.3.39.12
X-detected-operating-system: by eggs.gnu.org: Solaris 9
X-Received-From: 135.245.0.37
X-Mailman-Approved-At: Tue, 05 Apr 2011 21:04:48 -0400
Cc: "bug-global@gnu.org" <bug-global@gnu.org>
Subject: Re: C++ scoping of cross-reference?
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2011 17:10:31 -0000

On 04/04/2011 09:38 PM, Shigio YAMAGUCHI wrote:
>
>> This would provide class-qualifier definitions. When searching for a
>> definition, I would like to be able to optionally specify the class
>> qualifier. For example, consider:
>>
>> class A
>> {
>> public:
>>   virtual void dump();
>> };
>>
>> class B1 : public A
>> {
>> public:
>>   virtual void dump();
>> }
>>
>> class B2 : public B
>> {
>> public:
>>   virtual void dump();
>> }
>>
>> class C : public A
>> {
>> public:
>>   virtual void dump();
>> }
>>
>> If searching with "global -a dump" I would expect to see all of A::dump,
>> B1::dump, B2::dump, C::dump in the output. Alternatively, it should be
>> possible to search for "global -a B2::dump".
> What is the -a option? What occurs without it?
>
The -a option prints absolute pathnames for a file instead of relative
pathnames. It's unimportant for this example, I just always include it
when calling global.

> You mean the following behavior?
>
> [Class hierarchy]
>
> 	class A
> 	  |- class B
> 	       |- class C
>
> [Source files]
>
> 	[classA.cc]
> 	+--------------------------------
> 	|...
> 	|class A { void dump() {...}}
>
> 	[classB.cc]
> 	+--------------------------------
> 	|...
> 	|class B : A { void dump() {...}}
>
> 	[classC.cc]
> 	+--------------------------------
> 	|...
> 	|class C : B { void dump() {...}}
>
> [Execution image]
>
> 	$ global -x A::dump
> 	A::dump		classA.cc	 50 class A { void dump() {...} }
> 	B::dump		classB.cc	100 class B : A { void dump() {...} }
> 	C::dump		classC.cc	 90 class C : B { void dump() {...} }
> 	$ _
>
> 	$ global -x B::dump
> 	B::dump		classB.cc	100 class B : A { void dump() {...} }
> 	C::dump		classC.cc	 90 class C : B { void dump() {...} }
> 	$ _
>
> 	$ global -x C::dump
> 	C::dump		classC.cc	 90 class C : B { void dump() {...} }
> 	$ _
>

Yes, exactly. How would that work when the implementation doesn't
explicitly list the parent class though:

[Class hierarchy]

	class A
	  |- class B

[Source files]

	[classA.cc]
	+--------------------------------
	|...
	|class A { void dump() {...}}


	[classB.h]
	+--------------------------------
	|...
	|class B : A { void dump() };

	[classB.cc]
	+--------------------------------
	|...
	|void B::dump() {...}


[Execution image] - should give

	$ global -x A::dump
	A::dump		classA.cc	 50 class A { void dump() {...} }
	B::dump		classB.h	 20 class B : A { void dump() }
	B::dump		classB.cc	100 void B::dump() {...}

Would it still be possible to get that third line of output? 

>> Hopefully this could be extended to include references to class specific
>> methods, e.g. "global -r B2::dump". However I realize that determining
>> these kinds of references would likely be a lot harder.
> Would you please describe it for example?
> Why do you think it is a lot harder?

Sure. Extending the above example, consider:

[Class hierarchy]

	class A
	  |- class B

[Source files]

	[classA.cc]
	+--------------------------------
	|...
	|class A {
	|	virtual void dump() {...};
	|	void method2() {...};
	|};



	[classB.h]
	+--------------------------------
	|...
	|class B : A { void dump() };

	[classB.cc]
	+--------------------------------
	|...
	|void B::dump() {...}

	[other.cc]
	+--------------------------------
	|...
	|int main(int, int)
	|{
	|	B * b_p = new B;
	|	b_p->method2();
	|	b_p->dump();
	|	delete b_p;
	|
	|	B local_b;
	|	local_b.method2();
	|	local_b.dump();
	|
	|	A * a_p = new A;
	|	a_p->method2();
	|	delete a_p;
	|
	|	return 0; 
	|}

[Execution image] - should give

	$ global -x method2
	A::method2	classA.cc	 51 	void method2() {...};
	$_

	$ global -xr method2
	B::method2	other.cc	 20 	b_p->method2();
	B::method2	other.cc	 25 	local_b.method2();
	A::method2	other.cc	 30	a_p->method2();
	$_

	$ global -xr B::method2
	B::method2	other.cc	 20 	b_p->method2();
	B::method2	other.cc	 25 	local_b.method2();
	$_

	$ global -xr A::method2
	A::method2	other.cc	 30	a_p->method2();
	$_

I assumed this would be harder, because when a symbol is referenced
(e.g. the call to method2()), then you need to know the class that it is
actually referring to. However, I haven't looked at the internal
mechanism of building the gtags database, so maybe it isn't as hard as I
thought?

Cheers,

 Iain

-- 
Iain Woolf              W-CDMA Base Software, Alcatel-Lucent
Tel: 613-784-3465 / OnNET 2-825-3465
IM: iwoolf (im.ca.alcatel-lucent.com) / i_woolf (YahooIM)



From MAILER-DAEMON Tue Apr 05 22:26:41 2011
Received: from mailman by lists.gnu.org with archive (Exim 4.43)
	id 1Q7IS9-0005Su-9n
	for mharc-bug-global@gnu.org; Tue, 05 Apr 2011 22:26:41 -0400
Received: from [140.186.70.92] (port=42544 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q7IS3-0005So-42
	for bug-global@gnu.org; Tue, 05 Apr 2011 22:26:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1Q7IS1-0005KN-Ek
	for bug-global@gnu.org; Tue, 05 Apr 2011 22:26:34 -0400
Received: from msa103lp.auone-net.jp ([222.3.140.166]:56444)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1Q7IS0-0005J3-Vf; Tue, 05 Apr 2011 22:26:33 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa103lp.auone-net.jp (au one net msa) with ESMTP id E511730003A;
	Wed,  6 Apr 2011 11:26:26 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p362QQt0002537;
	Wed, 6 Apr 2011 11:26:26 +0900 (JST)
Message-Id: <201104060226.p362QQt0002537@tamacom.com>
To: Iain Woolf <iain.woolf@alcatel-lucent.com>
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <4D9B4CF3.1040808@alcatel-lucent.com>
In-reply-to: Message from Iain Woolf <iain.woolf@alcatel-lucent.com> of "Tue,
	05 Apr 2011 13:10:11 -0400." <4D9B4CF3.1040808@alcatel-lucent.com>
Date: Wed, 06 Apr 2011 11:26:26 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.166
Cc: "bug-global@gnu.org" <bug-global@gnu.org>
Subject: Re: C++ scoping of cross-reference?
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2011 02:26:40 -0000

> The -a option prints absolute pathnames for a file instead of relative
> pathnames. It's unimportant for this example, I just always include it
> when calling global.

Could you please review your example so as not to include what is not
important? If there are such things, it is difficult to understand your
intention. Thank you in advance.

> Yes, exactly. How would that work when the implementation doesn't
> explicitly list the parent class though:
> 
> [Class hierarchy]
> 
> 	class A
> 	  |- class B
> 
> [Source files]
> 
> 	[classA.cc]
> 	+--------------------------------
> 	|...
> 	|class A { void dump() {...}}
> 
> 
> 	[classB.h]
> 	+--------------------------------
> 	|...
> 	|class B : A { void dump() };
> 
> 	[classB.cc]
> 	+--------------------------------
> 	|...
> 	|void B::dump() {...}
> 
> 
> [Execution image] - should give
> 
> 	$ global -x A::dump
> 	A::dump		classA.cc	 50 class A { void dump() {...} }
> 	B::dump		classB.h	 20 class B : A { void dump() }
> 	B::dump		classB.cc	100 void B::dump() {...}
> 
> Would it still be possible to get that third line of output? 

Yes. It can be completely considered to be the same as the previous example.

> [Class hierarchy]
> 
> 	class A
> 	  |- class B
> 
> [Source files]
> 
> 	[classA.cc]
> 	+--------------------------------
> 	|...
> 	|class A {
> 	|	virtual void dump() {...};
> 	|	void method2() {...};
> 	|};
> 
> 
> 
> 	[classB.h]
> 	+--------------------------------
> 	|...
> 	|class B : A { void dump() };
> 
...
> 
> [Execution image] - should give
...
> 	$ global -xr B::method2
> 	B::method2	other.cc	 20 	b_p->method2();
> 	B::method2	other.cc	 25 	local_b.method2();
> 	$_

I have a question. What is the result of the following example?

 	$ global -x B::method2

> I assumed this would be harder, because when a symbol is referenced
> (e.g. the call to method2()), then you need to know the class that it is
> actually referring to. However, I haven't looked at the internal
> mechanism of building the gtags database, so maybe it isn't as hard as I
> thought?

I understood.
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Wed Apr 13 07:14:58 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Q9y2E-0003b9-Mz
	for mharc-bug-global@gnu.org; Wed, 13 Apr 2011 07:14:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58271)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <h-iwamoto@kit.hi-ho.ne.jp>) id 1Q9y29-0003aq-NU
	for bug-global@gnu.org; Wed, 13 Apr 2011 07:14:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <h-iwamoto@kit.hi-ho.ne.jp>) id 1Q9y23-0007AT-Q4
	for bug-global@gnu.org; Wed, 13 Apr 2011 07:14:53 -0400
Received: from mow600.mserv.hi-ho.ne.jp ([202.32.78.136]:44103
	helo=mow.mserv.hi-ho.ne.jp) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <h-iwamoto@kit.hi-ho.ne.jp>)
	id 1Q9y1v-00071d-SH; Wed, 13 Apr 2011 07:14:40 -0400
Received: by mow.mserv.hi-ho.ne.jp (mow600) id p3DBEW7A001123;
	Wed, 13 Apr 2011 20:14:33 +0900
Received: from [192.168.24.64] (osk34-p23.flets.hi-ho.ne.jp [121.102.170.23])
	by mbox.mserv.hi-ho.ne.jp (hiho-mbox605) id p3DBEV3s002546;
	Wed, 13 Apr 2011 20:14:32 +0900
Date: Wed, 13 Apr 2011 20:14:38 +0900
From: Hideki IWAMOTO <h-iwamoto@kit.hi-ho.ne.jp>
To: Shigio YAMAGUCHI <shigio@gnu.org>
Subject: Re: [Global-commit] global AUTHORS ChangeLog LICENSE acinclude.m4 c...
In-Reply-To: <E1PzKwj-0002Rt-Rj@vcs-noshell.in.savannah.gnu.org>
References: <E1PzKwj-0002Rt-Rj@vcs-noshell.in.savannah.gnu.org>
Message-Id: <20110413201437.3B21.1976CC75@kit.hi-ho.ne.jp>
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit
X-Mailer: Becky! ver. 2.56.05 [ja]
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 202.32.78.136
Cc: bug-global <bug-global@gnu.org>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Apr 2011 11:14:57 -0000

Hi.
> http://cvs.savannah.gnu.org/viewcvs/global/configure.ac?cvsroot=global&r1=1.120&r2=1.121

You deleted AC_CHECK_FUNCS, and added AC_FUNC_LSTAT. 
I think that this is a mistake.
Because AC_FUNC_LSTAT never defines HAVE_LSTAT, use of lstat is always
replaced by stat.


On Tue, 15 Mar 2011 03:29:21 +0000
Shigio YAMAGUCHI <shigio@gnu.org> wrote:

> CVSROOT:	/sources/global
> Module name:	global
> Changes by:	Shigio YAMAGUCHI <shigio>	11/03/15 03:29:21
> 
> Modified files:
> 	.              : AUTHORS ChangeLog LICENSE acinclude.m4 
> 	                 configure.ac 
> Added files:
> 	m4             : check_curses.m4 check_djgpp.m4 
> 
> Log message:
> 	Included cscope's source code.
> 
> CVSWeb URLs:
> http://cvs.savannah.gnu.org/viewcvs/global/AUTHORS?cvsroot=global&r1=1.48&r2=1.49
> http://cvs.savannah.gnu.org/viewcvs/global/ChangeLog?cvsroot=global&r1=1.127&r2=1.128
> http://cvs.savannah.gnu.org/viewcvs/global/LICENSE?cvsroot=global&r1=1.29&r2=1.30
> http://cvs.savannah.gnu.org/viewcvs/global/acinclude.m4?cvsroot=global&r1=1.15&r2=1.16
> http://cvs.savannah.gnu.org/viewcvs/global/configure.ac?cvsroot=global&r1=1.120&r2=1.121
> http://cvs.savannah.gnu.org/viewcvs/global/m4/check_curses.m4?cvsroot=global&rev=1.1
> http://cvs.savannah.gnu.org/viewcvs/global/m4/check_djgpp.m4?cvsroot=global&rev=1.1
> 
> _______________________________________________
> Global-commit mailing list
> Global-commit@gnu.org
> http://lists.gnu.org/mailman/listinfo/global-commit

-- 
Hideki IWAMOTO <h-iwamoto@kit.hi-ho.ne.jp>



From MAILER-DAEMON Wed Apr 13 18:49:21 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QA8sD-000875-Va
	for mharc-bug-global@gnu.org; Wed, 13 Apr 2011 18:49:21 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39417)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QA8sC-00086z-9G
	for bug-global@gnu.org; Wed, 13 Apr 2011 18:49:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QA8sB-0001Yt-G7
	for bug-global@gnu.org; Wed, 13 Apr 2011 18:49:20 -0400
Received: from msa106lp.auone-net.jp ([222.3.140.169]:39922)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1QA8sB-0001YU-8U; Wed, 13 Apr 2011 18:49:19 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa106lp.auone-net.jp (au one net msa) with ESMTP id 10F669403D;
	Thu, 14 Apr 2011 07:49:14 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3DMnENS001668;
	Thu, 14 Apr 2011 07:49:14 +0900 (JST)
Message-Id: <201104132249.p3DMnENS001668@tamacom.com>
To: Hideki IWAMOTO <h-iwamoto@kit.hi-ho.ne.jp>
Subject: Re: [Global-commit] global AUTHORS ChangeLog LICENSE acinclude.m4 c...
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <20110413201437.3B21.1976CC75@kit.hi-ho.ne.jp>
In-reply-to: Message from Hideki IWAMOTO <h-iwamoto@kit.hi-ho.ne.jp> of "Wed,
	13 Apr 2011 20:14:38 JST."
	<20110413201437.3B21.1976CC75@kit.hi-ho.ne.jp>
Date: Thu, 14 Apr 2011 07:49:14 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.169
Cc: bug-global <bug-global@gnu.org>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Apr 2011 22:49:21 -0000

Hi
> Hi.
> > http://cvs.savannah.gnu.org/viewcvs/global/configure.ac?cvsroot=global&r1=1.120&r2=1.121
> 
> You deleted AC_CHECK_FUNCS, and added AC_FUNC_LSTAT. 
> I think that this is a mistake.
> Because AC_FUNC_LSTAT never defines HAVE_LSTAT, use of lstat is always
> replaced by stat.

You are right. It was my carelessness.
I have recovered it.
Thank you for pointing out my mistake.
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Sat Apr 23 06:48:13 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDaNp-0000qv-Bw
	for mharc-bug-global@gnu.org; Sat, 23 Apr 2011 06:48:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55299)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ezolt@netapp.com>) id 1QDLWy-0002HX-Fq
	for bug-global@gnu.org; Fri, 22 Apr 2011 14:56:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ezolt@netapp.com>) id 1QDLWx-00043t-Hd
	for bug-global@gnu.org; Fri, 22 Apr 2011 14:56:40 -0400
Received: from mx2.netapp.com ([216.240.18.37]:16180)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ezolt@netapp.com>) id 1QDLWx-00043U-8s
	for bug-global@gnu.org; Fri, 22 Apr 2011 14:56:39 -0400
X-IronPort-AV: E=Sophos;i="4.64,255,1301900400"; d="scan'208";a="543173697"
Received: from smtp1.corp.netapp.com ([10.57.156.124])
	by mx2-out.netapp.com with ESMTP; 22 Apr 2011 11:56:20 -0700
Received: from [10.98.32.76] ([10.98.32.76])
	by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id
	p3MIuJOY006523
	for <bug-global@gnu.org>; Fri, 22 Apr 2011 11:56:20 -0700 (PDT)
Message-Id: <68AFEDCA-6982-41C7-B73A-515EB8F1BC81@netapp.com>
From: Phillip Ezolt <ezolt@netapp.com>
To: bug-global@gnu.org
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Subject: With a wacky macro before it, 'global' appears to miss a function
Date: Fri, 22 Apr 2011 14:57:51 -0400
X-Mailer: Apple Mail (2.936)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 216.240.18.37
X-Mailman-Approved-At: Sat, 23 Apr 2011 06:48:11 -0400
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 22 Apr 2011 18:56:41 -0000

If there is a wacky macro before a function, it appears as if global  
misses the functions after it.

Sample:
test.c:

#define STRUCT_DEF_MACRO(name, type)	\
struct name {			      	\
  	struct type *first;		\
}

STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;

void test_func(long dummy1, long dummy2)
{

}

.....
Current behavior:  (NOTICE: test_func is missing from the display)
[ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/ 
global/global -f test.c
STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name,  
type)	\
name                2 test.c           struct name {			      	\
STRUCT_DEF_MACRO    6 test.c           STRUCT_DEF_MACRO(my_struct,  
int) struct_instance_name;


Expected Behavior:
[ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/ 
global/global -f test.c
STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name,  
type)	\
name                2 test.c           struct name {			      	\
test_func           8 test.c           void test_func(long dummy1,  
long dummy2)


(NOTE: If you comment out the call to 'STRUCT_DEF_MACRO', things  
behave as expected..)

Cheers,
--Phil




From MAILER-DAEMON Sat Apr 23 19:27:08 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDmEG-0008IM-5l
	for mharc-bug-global@gnu.org; Sat, 23 Apr 2011 19:27:08 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60214)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDmEE-0008H4-DO
	for bug-global@gnu.org; Sat, 23 Apr 2011 19:27:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDmED-0002tk-De
	for bug-global@gnu.org; Sat, 23 Apr 2011 19:27:06 -0400
Received: from msa104lp.auone-net.jp ([222.3.140.167]:59596)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDmEC-0002tW-Sl
	for bug-global@gnu.org; Sat, 23 Apr 2011 19:27:05 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa104lp.auone-net.jp (au one net msa) with ESMTP id B1FB665003A;
	Sun, 24 Apr 2011 08:26:59 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3NNQwYc002388;
	Sun, 24 Apr 2011 08:26:58 +0900 (JST)
Message-Id: <201104232326.p3NNQwYc002388@tamacom.com>
To: Phillip Ezolt <ezolt@netapp.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <68AFEDCA-6982-41C7-B73A-515EB8F1BC81@netapp.com>
In-reply-to: Message from Phillip Ezolt <ezolt@netapp.com> of "Fri,
	22 Apr 2011 14:57:51 -0400."
	<68AFEDCA-6982-41C7-B73A-515EB8F1BC81@netapp.com>
Date: Sun, 24 Apr 2011 08:26:58 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.167
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 23 Apr 2011 23:27:07 -0000

Hello,
Thank you for the bug report.

To solve the problem, I would like to add a new rule like follows:

(In C parser)
A function definition must not have blank lines between the first "(" and the first "{".

o An example that is a definition.

int main(int argc, char *argv[])
{					<= blank lines don't exist.

	printf("Hello\n");

}

o An example that is not a definition.

int main(int argc, char *argv[])
					<= blank lines exist.
{

	printf("Hello\n");

}

The difference of the two is whether there are blank lines between
"main(" and the first "{".

What do you think?

> If there is a wacky macro before a function, it appears as if global  
> misses the functions after it.
> 
> Sample:
> test.c:
> 
> #define STRUCT_DEF_MACRO(name, type)	\
> struct name {			      	\
>   	struct type *first;		\
> }
> 
> STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;
> 
> void test_func(long dummy1, long dummy2)
> {
> 
> }
> 
> .....
> Current behavior:  (NOTICE: test_func is missing from the display)
> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/ 
> global/global -f test.c
> STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name,  
> type)	\
> name                2 test.c           struct name {			      	\
> STRUCT_DEF_MACRO    6 test.c           STRUCT_DEF_MACRO(my_struct,  
> int) struct_instance_name;
> 
> 
> Expected Behavior:
> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/ 
> global/global -f test.c
> STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name,  
> type)	\
> name                2 test.c           struct name {			      	\
> test_func           8 test.c           void test_func(long dummy1,  
> long dummy2)
> 
> 
> (NOTE: If you comment out the call to 'STRUCT_DEF_MACRO', things  
> behave as expected..)
> 
> Cheers,
> --Phil
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Sun Apr 24 01:23:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDrn0-0001Xv-83
	for mharc-bug-global@gnu.org; Sun, 24 Apr 2011 01:23:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53466)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QDolg-0000oi-O0
	for bug-global@gnu.org; Sat, 23 Apr 2011 22:09:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QDolf-0006SE-P5
	for bug-global@gnu.org; Sat, 23 Apr 2011 22:09:48 -0400
Received: from mx2.netapp.com ([216.240.18.37]:32626)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>)
	id 1QDolf-0006Rm-Ku; Sat, 23 Apr 2011 22:09:47 -0400
X-IronPort-AV: E=Sophos;i="4.64,260,1301900400"; d="scan'208";a="543344444"
Received: from smtp1.corp.netapp.com ([10.57.156.124])
	by mx2-out.netapp.com with ESMTP; 23 Apr 2011 19:09:39 -0700
Received: from sacrsexc2-prd.hq.netapp.com (sacrsexc2-prd.hq.netapp.com
	[10.99.115.28])
	by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id
	p3O29d64005214; Sat, 23 Apr 2011 19:09:39 -0700 (PDT)
Received: from rtprsexc1-prd.hq.netapp.com ([10.100.161.114]) by
	sacrsexc2-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Sat, 23 Apr 2011 19:09:39 -0700
Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.111]) by
	rtprsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Sat, 23 Apr 2011 22:09:37 -0400
Received: from 10.99.190.120 ([10.99.190.120]) by RTPMVEXC1-PRD.hq.netapp.com
	([10.100.161.119]) with Microsoft Exchange Server HTTP-DAV ; 
	Sun, 24 Apr 2011 02:09:37 +0000
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
References: <68AFEDCA-6982-41C7-B73A-515EB8F1BC81@netapp.com>
	<201104232326.p3NNQwYc002388@tamacom.com>
Content-Transfer-Encoding: quoted-printable
From: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>
Content-Type: text/plain;
	charset="us-ascii"
In-Reply-To: <201104232326.p3NNQwYc002388@tamacom.com>
Message-ID: <1083DEF1-A3BD-4F1D-A80F-34A6C4A6CD21@netapp.com>
Date: Sat, 23 Apr 2011 22:12:05 -0400
To: "Shigio YAMAGUCHI" <shigio@gnu.org>
Thread-Topic: With a wacky macro before it, 'global' appears to miss a function
Thread-Index: AcwCJKl5PXmB1vVGQ3efEr9lxRF1tA==
MIME-Version: 1.0 (iPad Mail 8G4)
X-OriginalArrivalTime: 24 Apr 2011 02:09:37.0785 (UTC)
	FILETIME=[A9CE4E90:01CC0224]
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 216.240.18.37
X-Mailman-Approved-At: Sun, 24 Apr 2011 01:23:21 -0400
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 02:09:49 -0000

Shigio,

On Apr 23, 2011, at 7:27 PM, "Shigio YAMAGUCHI" <shigio@gnu.org> wrote:

> Hello,
> Thank you for the bug report.
>=20
> To solve the problem, I would like to add a new rule like follows:
>=20

Thanks for looking at this.

> (In C parser)
> A function definition must not have blank lines between the first "(" and t=
he first "{".
>=20
> o An example that is a definition.
>=20
> int main(int argc, char *argv[])
> {                    <=3D blank lines don't exist.
>=20
>    printf("Hello\n");
>=20
> }
>=20
> o An example that is not a definition.
>=20
> int main(int argc, char *argv[])
>                    <=3D blank lines exist.
> {
>=20
>    printf("Hello\n");
>=20
> }
>=20
> The difference of the two is whether there are blank lines between
> "main(" and the first "{".
>=20
> What do you think?

That seems a little dangerous to me.  I could easily see someone adding an e=
xtra line after a function definition by accident,  and being completely con=
fused when that function doesn't show up. (leading to another bug report..)
...

Alternatively, would it be possible to use the semicolon at the end of the S=
TRUCT_DEF_MACRO to stop the parsing of that function? (so we move on to the n=
ext function..)

The rule should be something like: If we hit a semicolon,  and we don't have=
 any open braces, then consider the function to be complete..

Cheers,
--Phil
>=20
>> If there is a wacky macro before a function, it appears as if global =20
>> misses the functions after it.
>>=20
>> Sample:
>> test.c:
>>=20
>> #define STRUCT_DEF_MACRO(name, type)    \
>> struct name {                      \
>>      struct type *first;        \
>> }
>>=20
>> STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;
>>=20
>> void test_func(long dummy1, long dummy2)
>> {
>>=20
>> }
>>=20
>> .....
>> Current behavior:  (NOTICE: test_func is missing from the display)
>> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/=20=

>> global/global -f test.c
>> STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name, =20=

>> type)    \
>> name                2 test.c           struct name {                     =
 \
>> STRUCT_DEF_MACRO    6 test.c           STRUCT_DEF_MACRO(my_struct, =20
>> int) struct_instance_name;
>>=20
>>=20
>> Expected Behavior:
>> [ezolt@cyclptc11 test]$ ../global-5.9.4/gtags/gtags ; ../global-5.9.4/=20=

>> global/global -f test.c
>> STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name, =20=

>> type)    \
>> name                2 test.c           struct name {                     =
 \
>> test_func           8 test.c           void test_func(long dummy1, =20
>> long dummy2)
>>=20
>>=20
>> (NOTE: If you comment out the call to 'STRUCT_DEF_MACRO', things =20
>> behave as expected..)
>>=20
>> Cheers,
>> --Phil
> --
> Shigio YAMAGUCHI <shigio@gnu.org>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Sun Apr 24 02:23:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDsix-0004Hq-2I
	for mharc-bug-global@gnu.org; Sun, 24 Apr 2011 02:23:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36631)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDsiu-0004Gl-SW
	for bug-global@gnu.org; Sun, 24 Apr 2011 02:23:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDsit-0005lG-R5
	for bug-global@gnu.org; Sun, 24 Apr 2011 02:23:12 -0400
Received: from msa104lp.auone-net.jp ([222.3.140.167]:48482)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1QDsit-0005l4-FH; Sun, 24 Apr 2011 02:23:11 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa104lp.auone-net.jp (au one net msa) with ESMTP id B3B3565003A;
	Sun, 24 Apr 2011 15:23:08 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3O6N7gG003673;
	Sun, 24 Apr 2011 15:23:07 +0900 (JST)
Message-Id: <201104240623.p3O6N7gG003673@tamacom.com>
To: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <1083DEF1-A3BD-4F1D-A80F-34A6C4A6CD21@netapp.com>
In-reply-to: Message from "Ezolt, Phillip" <Phillip.Ezolt@netapp.com> of "Sat,
	23 Apr 2011 22:12:05 -0400."
	<1083DEF1-A3BD-4F1D-A80F-34A6C4A6CD21@netapp.com>
Date: Sun, 24 Apr 2011 15:23:07 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.167
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 06:23:13 -0000

> That seems a little dangerous to me.  I could easily see someone adding an e=
> xtra line after a function definition by accident,  and being completely con=
> fused when that function doesn't show up. (leading to another bug report..)
> ...
> 
> Alternatively, would it be possible to use the semicolon at the end of the S=
> TRUCT_DEF_MACRO to stop the parsing of that function? (so we move on to the n=
> ext function..)
> 
> The rule should be something like: If we hit a semicolon,  and we don't have=
>  any open braces, then consider the function to be complete..

It is a good rule.
However, may I throw away K&R style?

1. ANSI style
-------------

int
main(int argc, char **argv) {
	printf("Hello\n");
}

2. K&R(old) style
-----------------

int
main(argc, argv)
int argc;
char **argv;
{
	printf("Hello\n");
}

If we need not support K&R, I would like to adopt your rule.
What do you think?
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Sun Apr 24 05:55:49 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDw2f-0001sW-9E
	for mharc-bug-global@gnu.org; Sun, 24 Apr 2011 05:55:49 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36886)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <saffroy@gmail.com>) id 1QDusP-0006eU-SL
	for bug-global@gnu.org; Sun, 24 Apr 2011 04:41:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <saffroy@gmail.com>) id 1QDusO-0007VM-VR
	for bug-global@gnu.org; Sun, 24 Apr 2011 04:41:09 -0400
Received: from pas38-1-82-67-71-117.fbx.proxad.net ([82.67.71.117]:60733
	helo=siegfried.gbfo.org) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <saffroy@gmail.com>)
	id 1QDusO-0007VF-EI; Sun, 24 Apr 2011 04:41:08 -0400
Received: from erda.mds (localhost [127.0.0.1])
	by siegfried.gbfo.org (8.13.6/8.13.6) with ESMTP id p3O8HTWN032246;
	Sun, 24 Apr 2011 10:17:29 +0200
Received: from localhost (saffroy@localhost)
	by erda.mds (8.13.6/8.13.6/Submit) with ESMTP id p3O8HS0E032243;
	Sun, 24 Apr 2011 10:17:29 +0200
X-Authentication-Warning: erda.mds: saffroy owned process doing -bs
Date: Sun, 24 Apr 2011 10:17:28 +0200 (CEST)
From: Jean-Marc Saffroy <saffroy@gmail.com>
X-X-Sender: saffroy@erda.mds
To: Shigio YAMAGUCHI <shigio@gnu.org>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
In-Reply-To: <201104240623.p3O6N7gG003673@tamacom.com>
Message-ID: <Pine.LNX.4.64.1104240942060.14324@erda.mds>
References: <1083DEF1-A3BD-4F1D-A80F-34A6C4A6CD21@netapp.com>
	<201104240623.p3O6N7gG003673@tamacom.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: by amavisd-new
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 82.67.71.117
X-Mailman-Approved-At: Sun, 24 Apr 2011 05:55:48 -0400
Cc: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>, bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 08:41:10 -0000

Hi,

On Sun, 24 Apr 2011, Shigio YAMAGUCHI wrote:

> If we need not support K&R, I would like to adopt your rule.
> What do you think?

Unfortunately there is still a lot of old K&R code lying around. To me, it 
would be a pity if global dropped support for K&R.


Cheers,
JM

-- 
saffroy@gmail.com


From MAILER-DAEMON Sun Apr 24 07:53:13 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDxsH-0006ku-70
	for mharc-bug-global@gnu.org; Sun, 24 Apr 2011 07:53:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41107)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QDxbo-0006G8-VG
	for bug-global@gnu.org; Sun, 24 Apr 2011 07:36:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QDxbo-00085G-BM
	for bug-global@gnu.org; Sun, 24 Apr 2011 07:36:12 -0400
Received: from mx2.netapp.com ([216.240.18.37]:12043)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>)
	id 1QDxbi-00084X-NO; Sun, 24 Apr 2011 07:36:06 -0400
X-IronPort-AV: E=Sophos;i="4.64,263,1301900400"; d="scan'208";a="543394341"
Received: from smtp1.corp.netapp.com ([10.57.156.124])
	by mx2-out.netapp.com with ESMTP; 24 Apr 2011 04:35:48 -0700
Received: from sacrsexc1-prd.hq.netapp.com (sacrsexc1-prd.hq.netapp.com
	[10.99.115.27])
	by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id
	p3OBZmMO026196; Sun, 24 Apr 2011 04:35:48 -0700 (PDT)
Received: from rtprsexc1-prd.hq.netapp.com ([10.100.161.114]) by
	sacrsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Sun, 24 Apr 2011 04:35:49 -0700
Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.111]) by
	rtprsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Sun, 24 Apr 2011 07:35:47 -0400
Received: from 10.99.190.120 ([10.99.190.120]) by RTPMVEXC1-PRD.hq.netapp.com
	([10.100.161.119]) with Microsoft Exchange Server HTTP-DAV ; 
	Sun, 24 Apr 2011 11:35:47 +0000
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
Content-Transfer-Encoding: quoted-printable
From: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>
Content-Type: text/plain;
	charset="us-ascii"
Message-ID: <44365950-F4B0-4B33-AF9F-03E397DC7FB2@netapp.com>
Date: Sun, 24 Apr 2011 07:38:17 -0400
To: "Shigio YAMAGUCHI" <shigio@gnu.org>
Thread-Topic: With a wacky macro before it, 'global' appears to miss a function
Thread-Index: AcwCc8DsXuXDL34OSQCk6cU37vDxkg==
MIME-Version: 1.0 (iPad Mail 8G4)
X-OriginalArrivalTime: 24 Apr 2011 11:35:47.0522 (UTC)
	FILETIME=[C158D220:01CC0273]
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 216.240.18.37
X-Mailman-Approved-At: Sun, 24 Apr 2011 07:53:11 -0400
Cc: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>, bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 11:36:13 -0000

Shigio,

On Apr 24, 2011, at 2:23 AM, "Shigio YAMAGUCHI" <shigio@gnu.org> wrote:

>> That seems a little dangerous to me.  I could easily see someone adding a=
n e=3D
>> xtra line after a function definition by accident,  and being completely c=
on=3D
>> fused when that function doesn't show up. (leading to another bug report.=
.)
>> ...
>>=20
>> Alternatively, would it be possible to use the semicolon at the end of th=
e S=3D
>> TRUCT_DEF_MACRO to stop the parsing of that function? (so we move on to t=
he n=3D
>> ext function..)
>>=20
>> The rule should be something like: If we hit a semicolon,  and we don't h=
ave=3D
>> any open braces, then consider the function to be complete..
>=20
> It is a good rule.
> However, may I throw away K&R style?

Ouch. Yeah... we don't want to do that. I think we need k&r support.

>=20
> 1. ANSI style
> -------------
>=20
> int
> main(int argc, char **argv) {
>    printf("Hello\n");
> }
>=20
> 2. K&R(old) style
> -----------------
>=20
> int
> main(argc, argv)
> int argc;
> char **argv;
> {
>    printf("Hello\n");
> }
>=20
> If we need not support K&R, I would like to adopt your rule.
> What do you think?

Ok.. Ok. How about THIS rule.. (if this even possible?)

If we see a semicolon, AND then we see an open paren BEFORE we see an open b=
race, we know the token before the paren is a function and the previous func=
tion is complete?

That would catch this:
A() bob;
int foo() <=3D=3D=3D=3D this paren means the previous symbol is complete
{
}
...
But not k and r:
A(bar)
int bar;
{
}

> --
> Shigio YAMAGUCHI <shigio@gnu.org>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

Cheers,
--Phil=


From MAILER-DAEMON Sun Apr 24 09:28:59 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QDzMx-0003SG-Df
	for mharc-bug-global@gnu.org; Sun, 24 Apr 2011 09:28:59 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36203)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDzMv-0003Rf-8a
	for bug-global@gnu.org; Sun, 24 Apr 2011 09:28:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QDzMu-00061v-1E
	for bug-global@gnu.org; Sun, 24 Apr 2011 09:28:57 -0400
Received: from msa106lp.auone-net.jp ([222.3.140.169]:39619)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1QDzMt-00061k-Mx; Sun, 24 Apr 2011 09:28:55 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa106lp.auone-net.jp (au one net msa) with ESMTP id 6B30794036;
	Sun, 24 Apr 2011 22:28:51 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3ODSpGg002648;
	Sun, 24 Apr 2011 22:28:51 +0900 (JST)
Message-Id: <201104241328.p3ODSpGg002648@tamacom.com>
To: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>,
	"Jean-Marc Saffroy" <saffroy@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <44365950-F4B0-4B33-AF9F-03E397DC7FB2@netapp.com>
In-reply-to: Message from "Ezolt, Phillip" <Phillip.Ezolt@netapp.com> of "Sun,
	24 Apr 2011 07:38:17 -0400."
	<44365950-F4B0-4B33-AF9F-03E397DC7FB2@netapp.com>
Date: Sun, 24 Apr 2011 22:28:51 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.169
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2011 13:28:58 -0000

Jean-Marc Saffroy said:
> Unfortunately there is still a lot of old K&R code lying around. To me, it
> would be a pity if global dropped support for K&R.

Ezolt, Phillip said:
> Ouch. Yeah... we don't want to do that. I think we need k&r support.

OK. I won't stop the support of K&R.

> Ok.. Ok. How about THIS rule.. (if this even possible?)
> 
> If we see a semicolon, AND then we see an open paren BEFORE we see an open b=
> race, we know the token before the paren is a function and the previous func=
> tion is complete?
> 
> That would catch this:
> A() bob;
> int foo() <=3D=3D=3D=3D this paren means the previous symbol is complete
> {
> }
> ...
> But not k and r:
> A(bar)
> int bar;
> {
> }

It seems not to be able to handle the following K&R example:

int sort(v, n, cmp)
char *v[];
int n;
int (*cmp)();
{
        ...
}
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Mon Apr 25 10:19:18 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEMdC-0008VD-E5
	for mharc-bug-global@gnu.org; Mon, 25 Apr 2011 10:19:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57682)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ezolt@netapp.com>) id 1QELbZ-0006P5-NO
	for bug-global@gnu.org; Mon, 25 Apr 2011 09:13:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ezolt@netapp.com>) id 1QELbY-0000ie-TV
	for bug-global@gnu.org; Mon, 25 Apr 2011 09:13:33 -0400
Received: from mx2.netapp.com ([216.240.18.37]:59854)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ezolt@netapp.com>)
	id 1QELbW-0000h7-ML; Mon, 25 Apr 2011 09:13:30 -0400
X-IronPort-AV: E=Sophos;i="4.64,265,1301900400"; d="scan'208";a="543504036"
Received: from smtp1.corp.netapp.com ([10.57.156.124])
	by mx2-out.netapp.com with ESMTP; 25 Apr 2011 06:13:12 -0700
Received: from [10.98.32.76] ([10.98.32.76])
	by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id
	p3PDDBgP004013; Mon, 25 Apr 2011 06:13:11 -0700 (PDT)
Message-Id: <81884D9A-5E29-4EAB-AED3-E7514B58F0D2@netapp.com>
From: Phillip Ezolt <ezolt@netapp.com>
To: "Shigio YAMAGUCHI" <shigio@gnu.org>
In-Reply-To: <201104241328.p3ODSpGg002648@tamacom.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
Content-Transfer-Encoding: 7bit
Mime-Version: 1.0 (Apple Message framework v936)
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
Date: Mon, 25 Apr 2011 09:14:51 -0400
References: <44365950-F4B0-4B33-AF9F-03E397DC7FB2@netapp.com>
	<201104241328.p3ODSpGg002648@tamacom.com>
X-Mailer: Apple Mail (2.936)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 216.240.18.37
X-Mailman-Approved-At: Mon, 25 Apr 2011 10:19:17 -0400
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2011 13:13:35 -0000


On Apr 24, 2011, at 9:28 AM, Shigio YAMAGUCHI wrote:

> Jean-Marc Saffroy said:
>> Unfortunately there is still a lot of old K&R code lying around. To  
>> me, it
>> would be a pity if global dropped support for K&R.
>
> Ezolt, Phillip said:
>> Ouch. Yeah... we don't want to do that. I think we need k&r support.
>
> OK. I won't stop the support of K&R.
>
>> Ok.. Ok. How about THIS rule.. (if this even possible?)
>>
>> If we see a semicolon, AND then we see an open paren BEFORE we see  
>> an open b=
>> race, we know the token before the paren is a function and the  
>> previous func=
>> tion is complete?
>>
>> That would catch this:
>> A() bob;
>> int foo() <=3D=3D=3D=3D this paren means the previous symbol is  
>> complete
>> {
>> }
>> ...
>> But not k and r:
>> A(bar)
>> int bar;
>> {
>> }
>
> It seems not to be able to handle the following K&R example:
>
> int sort(v, n, cmp)
> char *v[];
> int n;
> int (*cmp)();
> {
>        ...
> }

Function pointers. Drat.

How about this:
...
If we see a ')' followed by an '{'  (with any number white space in  
between... but NO ';'), we have
a new symbol that we're dealing with.  (NOTE: This rule could ONLY be  
applied if we're NOT currently in a {} block)


Original example: ('foo' matches)
----------------
A() bob;
int foo()
{              <== ') {' means that we're dealing with a new symbol.
}

K & R:  ('cmp' DOESN'T since there is a ';' in between)
------
A(cmp)
int (*cmp)();
{
}
......

NOTE: This rule would also properly catch ANOTHER bug that we have but  
haven't reported yet...
(A is  a macro, and 'foo' isn't being reported.)
...
"
A()
int foo() { ... }
"


> --
> Shigio YAMAGUCHI <shigio@gnu.org>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3

Cheers,
--Phil


From MAILER-DAEMON Tue Apr 26 08:44:24 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QEhcu-0003je-GO
	for mharc-bug-global@gnu.org; Tue, 26 Apr 2011 08:44:24 -0400
Received: from eggs.gnu.org ([140.186.70.92]:44621)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QEhcs-0003jV-NS
	for bug-global@gnu.org; Tue, 26 Apr 2011 08:44:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QEhcr-00068K-FV
	for bug-global@gnu.org; Tue, 26 Apr 2011 08:44:22 -0400
Received: from msa103lp.auone-net.jp ([222.3.140.166]:46952)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1QEhcq-00067G-SU; Tue, 26 Apr 2011 08:44:21 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa103lp.auone-net.jp (au one net msa) with ESMTP id D3723300038;
	Tue, 26 Apr 2011 21:44:15 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3QCiEmW008404;
	Tue, 26 Apr 2011 21:44:14 +0900 (JST)
Message-Id: <201104261244.p3QCiEmW008404@tamacom.com>
To: Phillip Ezolt <ezolt@netapp.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <81884D9A-5E29-4EAB-AED3-E7514B58F0D2@netapp.com>
In-reply-to: Message from Phillip Ezolt <ezolt@netapp.com> of "Mon,
	25 Apr 2011 09:14:51 -0400."
	<81884D9A-5E29-4EAB-AED3-E7514B58F0D2@netapp.com>
Date: Tue, 26 Apr 2011 21:44:14 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.166
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2011 12:44:23 -0000

> If we see a ')' followed by an '{'  (with any number white space in  
> between... but NO ';'), we have
> a new symbol that we're dealing with.  (NOTE: This rule could ONLY be  
> applied if we're NOT currently in a {} block)

For this issue, it seems that complex rules complicate the problem
more and more. Because, using macros, programmers can make many things
which look like function declaration. It is difficult for us to treat
all of them.

Another proposal:
How about using ./.notfunction file? (This facility is undocumented.)

If you invoke gtags command with the following files.

[.notfunction]
+----------------------------
|STRUCT_DEF_MACRO                                                   <==

[test.c]
        +-------------------------------------------------------
     1  |#define STRUCT_DEF_MACRO(name, type)    \
     2  |struct name {                           \
     3  |        struct type *first;             \
     4  |}
     5  |
     6  |STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;     <==
     7  |
     8  |void test_func(long dummy1, long dummy2)
     9  |{
    10  |
    11  |}


1. WITH .notfunction file

$ global -f main.c
STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name, type)    \
name                2 test.c           struct name {                           \
test_func           8 test.c           void test_func(long dummy1, long dummy2)

2. WITHOUT .notfunction file

$ global -f main.c
STRUCT_DEF_MACRO    1 test.c           #define STRUCT_DEF_MACRO(name, type)    \
name                2 test.c           struct name {                           \
STRUCT_DEF_MACRO    6 test.c           STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;

It also works well with the following example:

A()
int foo() { ... }       

However, it is necessary to make .function file by hand. :<
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Wed Apr 27 10:15:20 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QF5WS-0002LG-J9
	for mharc-bug-global@gnu.org; Wed, 27 Apr 2011 10:15:20 -0400
Received: from eggs.gnu.org ([140.186.70.92]:50844)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QF5WM-0002LA-2j
	for bug-global@gnu.org; Wed, 27 Apr 2011 10:15:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QF5WH-0004fU-AK
	for bug-global@gnu.org; Wed, 27 Apr 2011 10:15:14 -0400
Received: from lo.gmane.org ([80.91.229.12]:35923)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QF5WH-0004e9-4s
	for bug-global@gnu.org; Wed, 27 Apr 2011 10:15:09 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QF5WA-0002fe-40
	for bug-global@gnu.org; Wed, 27 Apr 2011 16:15:02 +0200
Received: from mail.gateway.shenick.com ([62.77.176.130])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Wed, 27 Apr 2011 16:15:02 +0200
Received: from Marc.Herbert by mail.gateway.shenick.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Wed, 27 Apr 2011 16:15:02 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-global@gnu.org
From: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
Date: Wed, 27 Apr 2011 15:14:46 +0100
Lines: 19
Message-ID: <ip98co$akt$1@dough.gmane.org>
References: <81884D9A-5E29-4EAB-AED3-E7514B58F0D2@netapp.com>
	<201104261244.p3QCiEmW008404@tamacom.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: mail.gateway.shenick.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14
	Thunderbird/3.1.9
In-Reply-To: <201104261244.p3QCiEmW008404@tamacom.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 27 Apr 2011 14:15:19 -0000

Le 26/04/2011 13:44, Shigio YAMAGUCHI a =C3=A9crit :
> For this issue, it seems that complex rules complicate the problem
> more and more. Because, using macros, programmers can make many things
> which look like function declaration. It is difficult for us to treat
> all of them.

I fully second that. Macros should only be considered on a "best
effort" basis.=20

Since it is possible to do anything with macros, including the most
insane things, a 100% parsing success rate is impossible in the
presence of unusual macros (except by calling or re-implementing the
pre-processor itself). Global parsing rules should stay few and simple
enough so users can still understand them, and to avoid bugs. If that
allows "wacky" macros to eat some symbols then so be it. Global is a
great tool but people should still know how to use "grep" for corner
cases.





From MAILER-DAEMON Wed Apr 27 20:25:46 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFF3C-000605-V1
	for mharc-bug-global@gnu.org; Wed, 27 Apr 2011 20:25:46 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51174)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFF3B-0005zo-5n
	for bug-global@gnu.org; Wed, 27 Apr 2011 20:25:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFF3A-0001YA-76
	for bug-global@gnu.org; Wed, 27 Apr 2011 20:25:45 -0400
Received: from msa102lp.auone-net.jp ([222.3.140.165]:50543)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFF39-0001Xt-Vi
	for bug-global@gnu.org; Wed, 27 Apr 2011 20:25:44 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa102lp.auone-net.jp (au one net msa) with ESMTP id DEAEE668031;
	Thu, 28 Apr 2011 09:25:38 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3S0Pc11002170;
	Thu, 28 Apr 2011 09:25:38 +0900 (JST)
Message-Id: <201104280025.p3S0Pc11002170@tamacom.com>
To: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <ip98co$akt$1@dough.gmane.org>
In-reply-to: Message from Marc Herbert <Marc.Herbert@gmail.com>
	of "Wed, 27 Apr 2011 15:14:46 +0100." <ip98co$akt$1@dough.gmane.org>
Date: Thu, 28 Apr 2011 09:25:38 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.165
Cc: bug-global@gnu.org, Phillip Ezolt <ezolt@netapp.com>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 00:25:46 -0000

> 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?
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Wed Apr 27 22:30:05 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFGzV-00083K-Iu
	for mharc-bug-global@gnu.org; Wed, 27 Apr 2011 22:30:05 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47147)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QFG1l-000490-5N
	for bug-global@gnu.org; Wed, 27 Apr 2011 21:28:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>) id 1QFG1k-0001g9-5u
	for bug-global@gnu.org; Wed, 27 Apr 2011 21:28:21 -0400
Received: from mx2.netapp.com ([216.240.18.37]:23647)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <Phillip.Ezolt@netapp.com>)
	id 1QFG1j-0001g1-UG; Wed, 27 Apr 2011 21:28:20 -0400
X-IronPort-AV: E=Sophos;i="4.64,277,1301900400"; d="scan'208";a="544196092"
Received: from smtp1.corp.netapp.com ([10.57.156.124])
	by mx2-out.netapp.com with ESMTP; 27 Apr 2011 18:28:16 -0700
Received: from sacrsexc1-prd.hq.netapp.com (sacrsexc1-prd.hq.netapp.com
	[10.99.115.27])
	by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id
	p3S1SGt4023462; Wed, 27 Apr 2011 18:28:16 -0700 (PDT)
Received: from rtprsexc1-prd.hq.netapp.com ([10.100.161.114]) by
	sacrsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Wed, 27 Apr 2011 18:28:16 -0700
Received: from RTPMVEXC1-PRD.hq.netapp.com ([10.100.161.111]) by
	rtprsexc1-prd.hq.netapp.com with Microsoft SMTPSVC(6.0.3790.3959); 
	Wed, 27 Apr 2011 21:27:39 -0400
Received: from 10.99.190.119 ([10.99.190.119]) by RTPMVEXC1-PRD.hq.netapp.com
	([10.100.161.119]) with Microsoft Exchange Server HTTP-DAV ; 
	Thu, 28 Apr 2011 01:27:38 +0000
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
References: <ip98co$akt$1@dough.gmane.org>
	<201104280025.p3S0Pc11002170@tamacom.com>
Content-Transfer-Encoding: quoted-printable
From: "Ezolt, Phillip" <Phillip.Ezolt@netapp.com>
Content-Type: text/plain;
	charset="us-ascii"
In-Reply-To: <201104280025.p3S0Pc11002170@tamacom.com>
Message-ID: <73ECA825-F556-4EA7-A95D-5441D49B962E@netapp.com>
Date: Wed, 27 Apr 2011 21:30:31 -0400
thread-topic: With a wacky macro before it, 'global' appears to miss a function
thread-index: AcwFQ3YHtAbaZTOcRhynj18nKNjd7w==
To: "Shigio YAMAGUCHI" <shigio@gnu.org>
MIME-Version: 1.0 (iPad Mail 8G4)
X-OriginalArrivalTime: 28 Apr 2011 01:27:39.0512 (UTC)
	FILETIME=[76735780:01CC0543]
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 216.240.18.37
X-Mailman-Approved-At: Wed, 27 Apr 2011 22:30:04 -0400
Cc: bug-global@gnu.org, Marc Herbert <Marc.Herbert@gmail.com>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 01:28:22 -0000

This feels like the right solution.

ANSI C has been around for a long time... I'm pretty sure we'd be able to tu=
rn on the ANSI mode, and get the benefit of the better parsing.

Fwiw..  I wonder if old k and r compilers could even handle these wacky macr=
os. (if not.. You might never see these in this files..)

   Long term, global might need a way to specify ANSI on a file by file basi=
s for really big code bases.  (since some code bases may contain both..)

(or would the preferred solution be to build multiple tag files (some in k a=
nd r, some in ANSI), and the combine them together somehow?)

Cheers,
--Phil

On Apr 27, 2011, at 8:27 PM, "Shigio YAMAGUCHI" <shigio@gnu.org> wrote:

>> I fully second that. Macros should only be considered on a "best
>> effort" basis.=20
>=20
> "best effort" might be making two modes.
>=20
> 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.
>=20
> 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.
>=20
>> STRUCT_DEF_MACRO(my_struct, int) struct_instance_name;
>>=20
>> void test_func(long dummy1, long dummy2)
>> {
>=20
> The mode is specified by some environment variable.
>=20
> % gtags            <=3D the same behavior as old times
> % setenv GTAGSANSIC 1
> % gtags            <=3D ANSI C mode
>=20
> 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.
>=20
> What do you think?
> --
> Shigio YAMAGUCHI <shigio@gnu.org>
> PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Thu Apr 28 03:56:01 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFM4v-0006bl-Ij
	for mharc-bug-global@gnu.org; Thu, 28 Apr 2011 03:56:01 -0400
Received: from eggs.gnu.org ([140.186.70.92]:59566)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <saffroy@gmail.com>) id 1QFLam-0005ll-OX
	for bug-global@gnu.org; Thu, 28 Apr 2011 03:24:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <saffroy@gmail.com>) id 1QFLal-0002QB-Nq
	for bug-global@gnu.org; Thu, 28 Apr 2011 03:24:52 -0400
Received: from pas38-1-82-67-71-117.fbx.proxad.net ([82.67.71.117]:58261
	helo=siegfried.gbfo.org) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <saffroy@gmail.com>)
	id 1QFLah-0002O8-Hp; Thu, 28 Apr 2011 03:24:47 -0400
Received: from erda.mds (localhost [127.0.0.1])
	by siegfried.gbfo.org (8.13.6/8.13.6) with ESMTP id p3S7Ofu4014361;
	Thu, 28 Apr 2011 09:24:42 +0200
Received: from localhost (saffroy@localhost)
	by erda.mds (8.13.6/8.13.6/Submit) with ESMTP id p3S7OffT014358;
	Thu, 28 Apr 2011 09:24:41 +0200
X-Authentication-Warning: erda.mds: saffroy owned process doing -bs
Date: Thu, 28 Apr 2011 09:24:41 +0200 (CEST)
From: Jean-Marc Saffroy <saffroy@gmail.com>
X-X-Sender: saffroy@erda.mds
To: Shigio YAMAGUCHI <shigio@gnu.org>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
In-Reply-To: <201104280025.p3S0Pc11002170@tamacom.com>
Message-ID: <Pine.LNX.4.64.1104280859030.14324@erda.mds>
References: <ip98co$akt$1@dough.gmane.org>
	<201104280025.p3S0Pc11002170@tamacom.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Virus-Scanned: by amavisd-new
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 82.67.71.117
X-Mailman-Approved-At: Thu, 28 Apr 2011 03:56:00 -0400
Cc: bug-global@gnu.org, Marc Herbert <Marc.Herbert@gmail.com>,
	Phillip Ezolt <ezolt@netapp.com>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 07:24:53 -0000

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

-- 
saffroy@gmail.com


From MAILER-DAEMON Thu Apr 28 04:19:07 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFMRH-0000nU-AR
	for mharc-bug-global@gnu.org; Thu, 28 Apr 2011 04:19:07 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56958)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFMRE-0000nH-Kz
	for bug-global@gnu.org; Thu, 28 Apr 2011 04:19:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFMRA-00029z-BM
	for bug-global@gnu.org; Thu, 28 Apr 2011 04:19:04 -0400
Received: from lo.gmane.org ([80.91.229.12]:43621)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFMRA-00029u-1W
	for bug-global@gnu.org; Thu, 28 Apr 2011 04:19:00 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFMR8-0005Zl-Jc
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:18:58 +0200
Received: from mail.gateway.shenick.com ([62.77.176.130])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Thu, 28 Apr 2011 10:18:58 +0200
Received: from Marc.Herbert by mail.gateway.shenick.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Thu, 28 Apr 2011 10:18:58 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-global@gnu.org
From: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
Date: Thu, 28 Apr 2011 09:18:40 +0100
Lines: 25
Message-ID: <ipb7t4$1gd$1@dough.gmane.org>
References: <ip98co$akt$1@dough.gmane.org>	<201104280025.p3S0Pc11002170@tamacom.com>
	<73ECA825-F556-4EA7-A95D-5441D49B962E@netapp.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: mail.gateway.shenick.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14
	Thunderbird/3.1.9
In-Reply-To: <73ECA825-F556-4EA7-A95D-5441D49B962E@netapp.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 08:19:05 -0000

Le 28/04/2011 02:30, Ezolt, Phillip a =C3=A9crit :

> Long term, global might need a way to specify ANSI on a file by file
> basis for really big code bases.  (since some code bases may contain
> both..)

Good point, well spotted. This mode should be persisted in the
database(s) on a per file basis.

> (or would the preferred solution be to build multiple tag files
>  (some in k and r, some in ANSI), and the combine them together
>  somehow?)

How difficult would it be to implement a new, incremental "--add"
option like this:

# Adds specified files in old K&R mode
gtags -f "K&R fileset"

# Adds in new ANSI mode all files not already known=20
GTAGSANSI=3D1 gtags  --add

 =20





From MAILER-DAEMON Thu Apr 28 10:21:33 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFS61-00030D-Ln
	for mharc-bug-global@gnu.org; Thu, 28 Apr 2011 10:21:33 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53406)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFS5z-0002zW-3r
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:21:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFS5y-0006R1-1T
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:21:31 -0400
Received: from msa103lp.auone-net.jp ([222.3.140.166]:48502)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFS5x-0006QZ-KK
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:21:29 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa103lp.auone-net.jp (au one net msa) with ESMTP id 5573B300038;
	Thu, 28 Apr 2011 23:21:26 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3SELPmb015021;
	Thu, 28 Apr 2011 23:21:25 +0900 (JST)
Message-Id: <201104281421.p3SELPmb015021@tamacom.com>
To: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <ipb7t4$1gd$1@dough.gmane.org>
In-reply-to: Message from Marc Herbert <Marc.Herbert@gmail.com>
	of "Thu, 28 Apr 2011 09:18:40 +0100." <ipb7t4$1gd$1@dough.gmane.org>
Date: Thu, 28 Apr 2011 23:21:25 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.166
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 14:21:32 -0000

Marc Herbert <Marc.Herbert@gmail.com> wrote:
>> Long term, global might need a way to specify ANSI on a file by file
>> basis for really big code bases.  (since some code bases may contain
>> both..)
>
>Good point, well spotted. This mode should be persisted in the
>database(s) on a per file basis.

But "file base" cannot cover mixed code like follows:

http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/m32r/sim-if.c?rev=1.13&content-type=text/x-cvsweb-m
arkup&cvsroot=src

>How difficult would it be to implement a new, incremental "--add"
>option like this:
>
># Adds specified files in old K&R mode
>gtags -f "K&R fileset"
>
># Adds in new ANSI mode all files not already known 
>GTAGSANSI=1 gtags  --add

Why incremental?
Is it static information?
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Thu Apr 28 10:35:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFSJO-00040D-DW
	for mharc-bug-global@gnu.org; Thu, 28 Apr 2011 10:35:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57326)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFSJM-0003w3-F4
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:35:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFSJL-0008Jm-7h
	for bug-global@gnu.org; Thu, 28 Apr 2011 10:35:20 -0400
Received: from msa101lp.auone-net.jp ([222.3.140.164]:47687)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>)
	id 1QFSJK-0008JS-Ta; Thu, 28 Apr 2011 10:35:19 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa101lp.auone-net.jp (au one net msa) with ESMTP id 46BCF18C038;
	Thu, 28 Apr 2011 23:35:15 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3SEZE54015075;
	Thu, 28 Apr 2011 23:35:14 +0900 (JST)
Message-Id: <201104281435.p3SEZE54015075@tamacom.com>
To: Jean-Marc Saffroy <saffroy@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <Pine.LNX.4.64.1104280859030.14324@erda.mds>
In-reply-to: Message from Jean-Marc Saffroy <saffroy@gmail.com> of "Thu,
	28 Apr 2011 09:24:41 +0200."
	<Pine.LNX.4.64.1104280859030.14324@erda.mds>
Date: Thu, 28 Apr 2011 23:35:14 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.164
Cc: bug-global@gnu.org, Phillip Ezolt <ezolt@netapp.com>,
	Marc Herbert <Marc.Herbert@gmail.com>
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2011 14:35:21 -0000

Jean-Marc Saffroy <saffroy@gmail.com> wrote:
> 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-m
> arkup&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...

OK. K&R is forever.
 
> 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. :)

I agree. This simple tool can do only the work of 80%.

But the ANSI mode is not so bad. It does the work of 85% in ANSI source code.
Since new programs are sure to be written by ANSI style, the ANSI mode is
significant, I think.
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


From MAILER-DAEMON Fri Apr 29 04:12:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFio0-0002pc-1a
	for mharc-bug-global@gnu.org; Fri, 29 Apr 2011 04:12:04 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56131)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFiny-0002oS-B2
	for bug-global@gnu.org; Fri, 29 Apr 2011 04:12:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFinx-00048e-4l
	for bug-global@gnu.org; Fri, 29 Apr 2011 04:12:02 -0400
Received: from lo.gmane.org ([80.91.229.12]:60873)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFinw-00048N-P9
	for bug-global@gnu.org; Fri, 29 Apr 2011 04:12:01 -0400
Received: from list by lo.gmane.org with local (Exim 4.69)
	(envelope-from <gnu-bug-global@m.gmane.org>) id 1QFint-0002NA-CU
	for bug-global@gnu.org; Fri, 29 Apr 2011 10:11:57 +0200
Received: from gateway.shenick.com ([62.77.176.130])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Fri, 29 Apr 2011 10:11:57 +0200
Received: from Marc.Herbert by gateway.shenick.com with local (Gmexim 0.1
	(Debian)) id 1AlnuQ-0007hv-00
	for <bug-global@gnu.org>; Fri, 29 Apr 2011 10:11:57 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: bug-global@gnu.org
From: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
Date: Fri, 29 Apr 2011 09:11:38 +0100
Lines: 54
Message-ID: <ipdrrv$70l$1@dough.gmane.org>
References: <ipb7t4$1gd$1@dough.gmane.org>
	<201104281421.p3SELPmb015021@tamacom.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Complaints-To: usenet@dough.gmane.org
X-Gmane-NNTP-Posting-Host: gateway.shenick.com
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14
	Thunderbird/3.1.9
In-Reply-To: <201104281421.p3SELPmb015021@tamacom.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 80.91.229.12
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Apr 2011 08:12:03 -0000

Le 28/04/2011 15:21, Shigio YAMAGUCHI a =C3=A9crit :
> Marc Herbert <Marc.Herbert@gmail.com> wrote:
>>> Long term, global might need a way to specify ANSI on a file by file
>>> basis for really big code bases.  (since some code bases may contain
>>> both..)
>>
>> Good point, well spotted. This mode should be persisted in the
>> database(s) on a per file basis.
>=20
> But "file-based" cannot cover mixed code like follows:
>=20
> http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/m32r/sim-if.c?rev=3D1.=
13&content-type=3Dtext/x-cvsweb-markup&cvsroot=3Dsrc

No it would not. And it would not solve world hunger either :-)

I have little mercy for such horribly inconsistent code. Users would
probably have to make a choice between one or the other mode for this
file, whichever works best for it. But they should rather fix the
function prototypes to make this file internally consistent; this
would be a small and harmless change.

Let me re-iterate my preference: I think global should first and
foremost focus on doing a great and reliable job on *decent* code,
using a reasonable number of simple parsing rules, and a minimum
number of options (ideally zero). I LOVE the fact that global
currently works out of the box, in seconds, without any single command
line option to use, and almost no documentation to read. If that
causes global to miss a few dark corner cases then it is no big
deal. Just warn users they should not expect perfection.

>> How difficult would it be to implement a new, incremental "--add"
>> option like this:
>>
>> # Adds specified files in old K&R mode
>> gtags -f "K&R fileset"
>>
>> # Adds in new ANSI mode all files not already known=20
>> GTAGSANSI=3D1 gtags  --add
>=20
> Why incremental?

Only because it does not replace the existing database but adds new
files to it instead ("Incrementing" ~=3D "Adding")


> Is it static information?

Sorry I do not understand this question.

Cheers,

Marc




From MAILER-DAEMON Fri Apr 29 06:49:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QFlGE-00044B-JE
	for mharc-bug-global@gnu.org; Fri, 29 Apr 2011 06:49:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:49184)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFlGC-00043s-Fo
	for bug-global@gnu.org; Fri, 29 Apr 2011 06:49:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFlGB-00038q-Cj
	for bug-global@gnu.org; Fri, 29 Apr 2011 06:49:20 -0400
Received: from msa106lp.auone-net.jp ([222.3.140.169]:58692)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <shigio@tamacom.com>) id 1QFlGB-00038F-54
	for bug-global@gnu.org; Fri, 29 Apr 2011 06:49:19 -0400
Received: from choota.tamacom.com (KHP059138043202.ppp-bb.dion.ne.jp
	[59.138.43.202])
	by msa106lp.auone-net.jp (au one net msa) with ESMTP id 3036294036;
	Fri, 29 Apr 2011 19:49:13 +0900 (JST)
Received: from choota.tamacom.com (localhost [127.0.0.1]) by
	choota.tamacom.com (8.13.6/) with ESMTP id p3TAnCGF014857;
	Fri, 29 Apr 2011 19:49:12 +0900 (JST)
Message-Id: <201104291049.p3TAnCGF014857@tamacom.com>
To: Marc Herbert <Marc.Herbert@gmail.com>
Subject: Re: With a wacky macro before it, 'global' appears to miss a function
From: "Shigio YAMAGUCHI" <shigio@gnu.org>
References: <ipdrrv$70l$1@dough.gmane.org>
In-reply-to: Message from Marc Herbert <Marc.Herbert@gmail.com>
	of "Fri, 29 Apr 2011 09:11:38 +0100." <ipdrrv$70l$1@dough.gmane.org>
Date: Fri, 29 Apr 2011 19:49:12 +0900
Sender: shigio@tamacom.com
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 222.3.140.169
Cc: bug-global@gnu.org
X-BeenThere: bug-global@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: Bug reports for GNU GLOBAL <bug-global.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-global>
List-Post: <mailto:bug-global@gnu.org>
List-Help: <mailto:bug-global-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-global>,
	<mailto:bug-global-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 29 Apr 2011 10:49:21 -0000

> > But "file-based" cannot cover mixed code like follows:
> > 
> > http://sourceware.org/cgi-bin/cvsweb.cgi/src/sim/m32r/sim-if.c?rev=1.13&content-type=text/x-cvsw
> 
> No it would not. And it would not solve world hunger either :-)
> 
> I have little mercy for such horribly inconsistent code. Users would
> probably have to make a choice between one or the other mode for this
> file, whichever works best for it. But they should rather fix the
> function prototypes to make this file internally consistent; this
> would be a small and harmless change.

You are right. It was improper point.
"file base" is one of right views.

> Let me re-iterate my preference: I think global should first and
> foremost focus on doing a great and reliable job on *decent* code,
> using a reasonable number of simple parsing rules, and a minimum
> number of options (ideally zero). I LOVE the fact that global
> currently works out of the box, in seconds, without any single command
> line option to use, and almost no documentation to read. If that
> causes global to miss a few dark corner cases then it is no big
> deal. Just warn users they should not expect perfection.

Thank you for the statement.
I agree completely.
--
Shigio YAMAGUCHI <shigio@gnu.org>
PGP fingerprint: D1CB 0B89 B346 4AB6 5663  C4B6 3CA5 BBB3 57BE DDA3


