From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19984 invoked by alias); 11 Jul 2005 07:11:19 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 19644 invoked by uid 22791); 11 Jul 2005 07:11:00 -0000 Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Mon, 11 Jul 2005 07:11:00 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1DrsR6-0005aI-EV for gdb@sources.redhat.com; Mon, 11 Jul 2005 09:10:40 +0200 Received: from zigzag.lvk.cs.msu.su ([158.250.17.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jul 2005 09:10:40 +0200 Received: from ghost by zigzag.lvk.cs.msu.su with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 11 Jul 2005 09:10:40 +0200 To: gdb@sources.redhat.com From: Vladimir Prus Subject: Re: Formatting of function pointer value Date: Mon, 11 Jul 2005 07:11:00 -0000 Message-ID: References: <20050708135830.GC17089@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.8.2 X-SW-Source: 2005-07/txt/msg00100.txt.bz2 Vladimir Prus wrote: > Daniel Jacobowitz wrote: > >> On Fri, Jul 08, 2005 at 12:50:48PM +0400, Vladimir Prus wrote: >>> Vladimir Prus wrote: >>> >>> >>> > the value of *p3 is printed like this: >>> > >>> > (gdb) print *p3 >>> > $1 = {int (int)} 0xb7ee6e9c <__DTOR_END__+4> >>> >>> Even more strange is this: >>> >>> (gdb) print p3 >>> $2 = (int (*)(int)) 0xb7ee6e9c <__DTOR_END__+4> >>> (gdb) print *p3 >>> $3 = {int (int)} 0xb7ee6e9c <__DTOR_END__+4> >>> >>> Why does formatting of the type different in the second case, and uses >>> braces instead of parenthesis? >> >> One is a pointer to function, the other is a function. > > I'm sorry, I don't understand this. Is human user supposed to know that > '{' starts a function? What harm will it make if parenthesis are used in > both cases? BTW, the code in question says: /* FIXME, we should consider, at least for ANSI C language, eliminating the distinction made between FUNCs and POINTERs to FUNCs. */ fprintf_filtered (stream, "{"); type_print (type, "", stream, -1); fprintf_filtered (stream, "} "); Is "FIXME" still relevant? - Volodya