Bug 9514 - (void(**)()) is syntax error
Summary: (void(**)()) is syntax error
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: exp (show other bugs)
Version: 6.7
: P3 normal
Target Milestone: 7.5
Assignee: Tom Tromey
URL:
Keywords:
: 9513 10940 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-01-17 19:08 UTC by gin
Modified: 2012-06-19 19:50 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gin 2008-01-17 19:08:01 UTC
[Converted from Gnats 2409]

Posted to <bug-gdb@gnu.org> since Fri, 31 Mar 2006 22:12:41 +0400
(<66bqvm8ova.fsf@mo.msk.ru>).

In C `(void(**)())EXPR' type cast expression means the same as
`(void(*(*))())EXPR'.

(gdb) sho lang
The current source language is "auto; currently c".

With this setting, expecting that `gdb' also processes both of these
expressions the same way.  Instead:

(gdb) p*(void(**)())$addr
A syntax error in expression, near `*)())$addr'.

Release:
6.3, 6.4, 6.6, 6.7.1

Environment:
Observed in x86_64-unknown-linux-gnu, i686-pc-linux-gnu.  Seen no
changes.  Hardly matters at all.

How-To-Repeat:
p*(void(**)())$addr
Comment 1 Tom Tromey 2008-08-19 07:11:28 UTC
Responsible-Changed-From-To: unassigned->tromey
Responsible-Changed-Why: Testing a patch.
Comment 2 Tom Tromey 2010-01-24 02:17:31 UTC
*** Bug 10940 has been marked as a duplicate of this bug. ***
Comment 3 Sourceware Commits 2012-06-19 19:49:51 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	tromey@sourceware.org	2012-06-19 19:49:43

Modified files:
	gdb            : ChangeLog c-exp.y parse.c parser-defs.h 
	gdb/testsuite  : ChangeLog 
	gdb/testsuite/gdb.base: whatis.exp 

Log message:
	PR exp/9514:
	* parser-defs.h (insert_type, insert_type_address_space): Declare.
	(push_type_address_space): Remove.
	* parse.c (insert_into_type_stack): New function.
	(insert_type): Likewise.
	(insert_type_address_space): Rename from push_type_address_space.
	Insert tp_space_identifier.
	* c-exp.y (ptr_operator): New production.
	(abs_decl): Use ptr_operator.
	(space_identifier): Call insert_type_address_space.
	(ptype): Don't use const_or_volatile_or_space_identifier.
	(const_or_volatile_noopt): Call insert_type.
	(conversion_type_id, conversion_declarator): New productions.
	(operator): Use conversion_type_id.
	testsuite
	* gdb.base/whatis.exp: Add tests.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.14387&r2=1.14388
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/c-exp.y.diff?cvsroot=src&r1=1.91&r2=1.92
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/parse.c.diff?cvsroot=src&r1=1.117&r2=1.118
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/parser-defs.h.diff?cvsroot=src&r1=1.43&r2=1.44
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.3231&r2=1.3232
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.base/whatis.exp.diff?cvsroot=src&r1=1.18&r2=1.19
Comment 4 Tom Tromey 2012-06-19 19:50:46 UTC
Fixed.