all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* etags: function not indexed after macro
@ 2006-05-12  8:53 Roman Pletka
  2006-05-13  8:00 ` Eli Zaretskii
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Pletka @ 2006-05-12  8:53 UTC (permalink / raw)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

I tried to index the following code with etags:

#define DECLARE_TEST(name)      \
        static int test_##name;

DECLARE_TEST(var)



void my_func(int i) {
        test_var = i;
}

void my_func2(int j) {
        test_var = j;
}


It looks like etags does not create an entry for the my_func function because
the closing semicolon is in the definition of the macro. I am using etags that
comes with GNU Emacs 21.4 (Debian emacs21 21.4a-3). I tried the same code with
cscope and there it works.

Best regards,
Roman Pletka


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEZE0Y9GOBmbEdi04RAvUyAKDJ27k3wdlPhN4/zHq9a+fP/KknzgCfYLC1
mSKquH6hzoWMf0LRXzvL/14=
=Tizo
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 3+ messages in thread
* Re: etags: function not indexed after macro
@ 2006-05-23 11:11 Francesco Potorti`
  0 siblings, 0 replies; 3+ messages in thread
From: Francesco Potorti` @ 2006-05-23 11:11 UTC (permalink / raw)
  Cc: bug-gnu-emacs

Dear Roman,

the etags bug that you signaled:

>#define DECLARE_TEST(name)      \
>        static int test_##name;
>
>DECLARE_TEST(var)
>
>
>
>void my_func(int i) {
>        test_var = i;
>}
>
>void my_func2(int j) {
>        test_var = j;
>}
>
>
>It looks like etags does not create an entry for the my_func function because
>the closing semicolon is in the definition of the macro. I am using etags that
>comes with GNU Emacs 21.4 (Debian emacs21 21.4a-3). I tried the same code with
>cscope and there it works.

as Eli Zaretskii correctly explains, has an easy and recommended
workaround.

I will try nonetheless to correct the bug, but I am not sure if this can
be done, because of the way the etags parser is implemented.  Do you
have any strong reasons why you should use this style

================
   #define DECLARE_TEST(name) static int test_##name;
   
   DECLARE_TEST(var)
================

rather than this style?

================
   #define DECLARE_TEST(name) static int test_##name
   
   DECLARE_TEST(var);
================

Thank for your bug report, and please try to answer my question.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2006-05-23 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-12  8:53 etags: function not indexed after macro Roman Pletka
2006-05-13  8:00 ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2006-05-23 11:11 Francesco Potorti`

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.