unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* imenu fails to index C function with function pointer as parameter
@ 2011-08-22  6:02 Liang Wang
  2011-08-23 13:16 ` Alan Mackenzie
  2011-08-26 19:34 ` Alan Mackenzie
  0 siblings, 2 replies; 4+ messages in thread
From: Liang Wang @ 2011-08-22  6:02 UTC (permalink / raw)
  To: emacs-devel

Hi,

When I try to jump to a function definition which has a function
pointer as one of its parameters, imenu fails to recognize such
function.  One example is

static rtx
substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
		    rtx (*address_fn) (rtx))

which is from gcc source code in gcc/genattrtab.c.

To reproduce it, run

M-x imenu RET sub TAB

And then, I get [No match].  Other functions are just fine.


Thanks,
Liang.



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

* Re: imenu fails to index C function with function pointer as parameter
  2011-08-22  6:02 imenu fails to index C function with function pointer as parameter Liang Wang
@ 2011-08-23 13:16 ` Alan Mackenzie
  2011-08-26 19:34 ` Alan Mackenzie
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2011-08-23 13:16 UTC (permalink / raw)
  To: Liang Wang; +Cc: emacs-devel

Hi, Liang.

On Mon, Aug 22, 2011 at 02:02:12PM +0800, Liang Wang wrote:
> Hi,

> When I try to jump to a function definition which has a function
> pointer as one of its parameters, imenu fails to recognize such
> function.  One example is

> static rtx
> substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
> 		    rtx (*address_fn) (rtx))

> which is from gcc source code in gcc/genattrtab.c.

> To reproduce it, run

> M-x imenu RET sub TAB

> And then, I get [No match].  Other functions are just fine.

This is a bug.  I'm looking at it at the moment.  Hopefully I'll have a
fix in a few days.

> Thanks,
> Liang.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: imenu fails to index C function with function pointer as parameter
  2011-08-22  6:02 imenu fails to index C function with function pointer as parameter Liang Wang
  2011-08-23 13:16 ` Alan Mackenzie
@ 2011-08-26 19:34 ` Alan Mackenzie
  1 sibling, 0 replies; 4+ messages in thread
From: Alan Mackenzie @ 2011-08-26 19:34 UTC (permalink / raw)
  To: Liang Wang; +Cc: emacs-devel

Hi, Liang.

On Mon, Aug 22, 2011 at 02:02:12PM +0800, Liang Wang wrote:
> Hi,

> When I try to jump to a function definition which has a function
> pointer as one of its parameters, imenu fails to recognize such
> function.  One example is

> static rtx
> substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
> 		    rtx (*address_fn) (rtx))

> which is from gcc source code in gcc/genattrtab.c.

> To reproduce it, run

> M-x imenu RET sub TAB

> And then, I get [No match].  Other functions are just fine.

Thanks for taking the trouble to report this bug.  I think this patch
fixes it.  Would you please try it out and confirm it's OK.


*** orig/cc-menus.el	2011-08-26 17:24:29.000000000 +0000
--- cc-menus.el	2011-08-26 19:22:03.000000000 +0000
***************
*** 110,117 ****
         "[^" c-alnum "_:<>~]"		      ; match any non-identifier char
         "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name
         "\\([ \t\n]\\|\\\\\n\\)*("	      ; see above, BUT the arg list
!        "\\([ \t\n]\\|\\\\\n\\)*\\([^ \t\n(*][^)]*\\)?)" ; must not start
!        "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]"    ; with an asterisk or parentheses
         ) 1)
      ;; Special case for definitions using phony prototype macros like:
      ;; `int main _PROTO( (int argc,char *argv[]) )'.
--- 110,120 ----
         "[^" c-alnum "_:<>~]"		      ; match any non-identifier char
         "\\([" c-alpha "_][" c-alnum "_:<>~]*\\)" ; match function name
         "\\([ \t\n]\\|\\\\\n\\)*("	      ; see above, BUT the arg list
!        "\\([ \t\n]\\|\\\\\n\\)*"	      ; must not start
!        "\\([^ \t\n(*]"			      ; with an asterisk or parentheses
!        "[^()]*\\(([^()]*)[^()]*\\)*"	      ; Maybe function pointer arguments
!        "\\)?)"
!        "\\([ \t\n]\\|\\\\\n\\)*[^ \t\n;(]"
         ) 1)
      ;; Special case for definitions using phony prototype macros like:
      ;; `int main _PROTO( (int argc,char *argv[]) )'.


> Thanks,
> Liang.

-- 
Alan Mackenzie (Nuremberg, Germany).



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

* Re: imenu fails to index C function with function pointer as parameter
@ 2011-08-27 16:31 Angelo Graziosi
  0 siblings, 0 replies; 4+ messages in thread
From: Angelo Graziosi @ 2011-08-27 16:31 UTC (permalink / raw)
  To: emacs

Hi Alan,

> I think this patch
> fixes it

this bug looks similar to that flagged here:

   https://lists.gnu.org/archive/html/bug-gnu-emacs/2011-07/msg02023.html


Have you idea/suggestions about it?

Thanks,
Angelo.



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

end of thread, other threads:[~2011-08-27 16:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-22  6:02 imenu fails to index C function with function pointer as parameter Liang Wang
2011-08-23 13:16 ` Alan Mackenzie
2011-08-26 19:34 ` Alan Mackenzie
  -- strict thread matches above, loose matches on Subject: below --
2011-08-27 16:31 Angelo Graziosi

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).