From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18590 invoked by alias); 3 Feb 2002 22:52:21 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 18517 invoked from network); 3 Feb 2002 22:52:18 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 3 Feb 2002 22:52:18 -0000 Received: from drow by nevyn.them.org with local (Exim 3.34 #1 (Debian)) id 16XVUp-0006s0-00; Sun, 03 Feb 2002 17:52:27 -0500 Date: Sun, 03 Feb 2002 14:52:00 -0000 From: Daniel Jacobowitz To: Jim Blandy Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: complex numbers in c-valprint.c Message-ID: <20020203175227.A26302@nevyn.them.org> Mail-Followup-To: Jim Blandy , gdb-patches@sources.redhat.com References: <20020130233143.A21333@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.23i X-SW-Source: 2002-02/txt/msg00043.txt.bz2 On Sun, Feb 03, 2002 at 05:44:50PM -0500, Jim Blandy wrote: > > Daniel Jacobowitz writes: > > This patch fixes half of gdb/320. The other half is a bug in GCC 3.x, that > > I just CC'd gdb@ about. > > > > Is this OK to commit? Does anyone have a preference for {0, 0} vs. { re = > > 0, im = 0}? I used the former. > > {0, 0} looks to me like GDB's syntax for array literals. In ISO C > programs, don't you just write complex literals as x+I*y? What's wrong > with GDB printing that? > > If you say, "It shouldn't be an expression!", then I'll just say, "We > already print negative numbers as an expression!" Lexically speaking, > C integer literals can't have a sign. `-3' is an application of the > prefix operator `-' to the literal `3'. Since the spec promises that > the compiler will fold constant expressions, you don't need a > dedicated syntax for negative numbers. I assume the same thinking is > behind the lack of any syntactic support for complex literals. x + y * I, I think. That's nice; I didn't realize C99 and supported ``I''. OK with that syntax change? > (The bikeshed should be a nice yellow-green, I think.) ... -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer