From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5699 invoked by alias); 3 Feb 2002 22:43: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 5612 invoked from network); 3 Feb 2002 22:43:17 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 3 Feb 2002 22:43:17 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 38AF25E9DE; Sun, 3 Feb 2002 17:44:51 -0500 (EST) To: Daniel Jacobowitz Cc: gdb-patches@sources.redhat.com Subject: Re: RFA: complex numbers in c-valprint.c References: <20020130233143.A21333@nevyn.them.org> From: Jim Blandy Date: Sun, 03 Feb 2002 14:43:00 -0000 In-Reply-To: <20020130233143.A21333@nevyn.them.org> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00042.txt.bz2 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. (The bikeshed should be a nice yellow-green, I think.)