From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59405 invoked by alias); 28 Jan 2020 01:29:58 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 59390 invoked by uid 89); 28 Jan 2020 01:29:58 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1329, C89, H*f:sk:PUp910N, H*f:sk:dBRbdDW X-HELO: mail-pl1-f178.google.com Received: from mail-pl1-f178.google.com (HELO mail-pl1-f178.google.com) (209.85.214.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 28 Jan 2020 01:29:56 +0000 Received: by mail-pl1-f178.google.com with SMTP id g6so4449754plt.2; Mon, 27 Jan 2020 17:29:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ljKjHEqHx6XxGjfmG8qKmnJgGGQdX+LbTfkpJAUkeQM=; b=Q3atWlDhSV0CmiKkl4BKBtngf8mW1gdvRYecW9HUebzYB6JwiT+jhMHM8GPqSxFIW8 QEBJGO5dTTq/vEcRYyg67CHkm4itig5ifbZlr1rB8CWj4SZXnS1+z36Z6zFwG4s5xzwO F+i55FfxcraIwXG/O/XhkDyFAHraFWDaHXx4HJgN2wv1o7Km+rxHsMxKIrrc5705VgkA zF3ugyJwUDFLQsaUu6XDgwcIsG9afK4akuf+Fc0B9y94HmT+c4g6IeEP4bzpVcOD5wvk v1cMzs9E6r2117BI8hmztzliHaPat2CTzRK1suu3ZtOzF4yvWLReSJWeOTVg60GVvHzu hr0w== Return-Path: Received: from bubble.grove.modra.org ([2406:3400:51d:8cc0:59a8:73be:c607:1a2c]) by smtp.gmail.com with ESMTPSA id r8sm315895pjo.22.2020.01.27.17.29.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2020 17:29:54 -0800 (PST) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 42981803DE; Tue, 28 Jan 2020 11:59:50 +1030 (ACDT) Date: Tue, 28 Jan 2020 01:29:00 -0000 From: Alan Modra To: Christian Biesinger Cc: binutils@sourceware.org, gdb@sourceware.org Subject: Re: Allow C99/C11 in bfd? Message-ID: <20200128012949.GY4433@bubble.grove.modra.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2020-01/txt/msg00070.txt.bz2 On Thu, Jan 23, 2020 at 11:37:27AM +0100, Christian Biesinger via binutils wrote: > I noticed that bfd is currently using C89. I was wondering if there > are any thoughts on allowing C99/C11 in there? It would be nice to be > able to declare variables at the time of first use, among other useful > features. It wasn't so long ago that we were using K&R. :-) One of the reasons people used to give for being conservative is that binutils is right at the bottom of the toolchain, and when bootstrapping a new native GNU toolchain target you might not have much in the way of native compiler support. If there isn't an intention of porting gcc for the target (or such support is delayed) then cross-compiling might not be an option. This all presumes a native development system running some sort of OS, but those days are past. With the ubiquity of PCs, nowadays you'll invariably have a cross-toolchain for a new cpu. So there isn't any real reason to stick with c89 IMO. > (I'm not even going to ask about C++, although I think that would be nice) I think any meaningful use of C++ would require a rewrite of BFD. Just satisfying -Wc++-compat is a waste of time and results in a lot of useless casts on bfd_alloc and similar that clutter the source. -- Alan Modra Australia Development Lab, IBM