Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [BUG] Parser error for "pointer to a function pointer"
@ 2011-09-04  9:22 Abhijit Halder
  2011-09-04 10:43 ` Abhijit Halder
  0 siblings, 1 reply; 5+ messages in thread
From: Abhijit Halder @ 2011-09-04  9:22 UTC (permalink / raw)
  To: gdb-patches

Hello everybody,

While working with gdb I have encountered the following problem.

GNU gdb (GDB) 7.3.50.20110814-cvs
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
(gdb) ptype int(**)(void)
A syntax error in expression, near `*)(void)'.


I have made the following changes to fix this issue.


--- src/gdb/c-exp.y	2011-05-06 19:42:17.000000000 +0530
+++ dst/gdb/c-exp.y	2011-09-04 13:57:16.082207664 +0530
@@ -19,7 +19,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

 /* Parse a C expression from text in a string,
-   and return the result as a  struct expression  pointer.
+   and return the result as a  struct expression pointer.
    That structure contains arithmetic operations in reverse polish,
    with constants represented by operations that are followed by special data.
    See expression.h for the details of the format.
@@ -926,12 +926,12 @@ const_or_volatile_or_space_identifier:

 abs_decl:	'*'
 			{ push_type (tp_pointer); $$ = 0; }
-	|	'*' abs_decl
-			{ push_type (tp_pointer); $$ = $2; }
+	|	abs_decl '*'
+			{ push_type (tp_pointer); $$ = $1; }
 	|	'&'
 			{ push_type (tp_reference); $$ = 0; }
-	|	'&' abs_decl
-			{ push_type (tp_reference); $$ = $2; }
+	|	abs_decl '&'
+			{ push_type (tp_reference); $$ = $1; }
 	|	direct_abs_decl
 	;

Thanks,
Abhijit Halder


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

end of thread, other threads:[~2011-09-04 14:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-04  9:22 [BUG] Parser error for "pointer to a function pointer" Abhijit Halder
2011-09-04 10:43 ` Abhijit Halder
2011-09-04 10:47   ` Abhijit Halder
2011-09-04 13:54     ` Abhijit Halder
2011-09-04 14:52       ` Jan Kratochvil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox