From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6464B3858C52 for ; Wed, 11 Oct 2023 08:10:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6464B3858C52 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697011827; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ARtbZlLGSQjOmg3ecJA2VbaU4mgvEit3ySZd4jlGTT4=; b=QM0FGjuk4QBmJtHBwgeJzYEkJfYz0jHvJvi5mDoB+/aC4tjw8ni+Qo+NIQ7R3slsYl3wad Mu66PIJGIvDLephzw91m0vRuT8x4mI7pwSFdIzIFwFSn+bhcq0iajha5xWPpbRf6hJsZGe 3ueF64YBMQM/clTiFWy0peMLPbdn3kg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-398-fA_ZxETWPSGTa62MiLprgg-1; Wed, 11 Oct 2023 04:10:23 -0400 X-MC-Unique: fA_ZxETWPSGTa62MiLprgg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 39BE01818E41; Wed, 11 Oct 2023 08:10:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A536840C6F7F; Wed, 11 Oct 2023 08:10:22 +0000 (UTC) From: Florian Weimer To: David Brown Cc: Jason Merrill , gcc@gcc.gnu.org Subject: Re: C89 question: Do we need to accept -Wint-conversion warnings References: <87h6myaf6b.fsf@oldenburg.str.redhat.com> <75b14d17-896c-db03-fad1-1931f39533e6@westcontrol.com> Date: Wed, 11 Oct 2023 10:10:21 +0200 In-Reply-To: <75b14d17-896c-db03-fad1-1931f39533e6@westcontrol.com> (David Brown's message of "Wed, 11 Oct 2023 09:36:32 +0200") Message-ID: <8734yhy3yq.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: * David Brown: > So IMHO (and as I am not a code contributor to GCC, my opinion really > is humble) it is better to be stricter than permissive, even in old > standards. It is particularly important for "-std=c89", while > "-std=gnu89" is naturally more permissive. (I have seen more than > enough terrible code in embedded programs - I don't want to make it > easier for them to write even worse code!) We can probably make (say) -std=gnu89 -fno-permissive work, in a way that is a bit less picky than -std=gnu89 -pedantic-errors today. And of course there's still -Werror, that's not going to go away. So if you are using -Werror=implicit-function-declaration today (as you probably should 8-), nothing changes for you in GCC 14. > I suspect (again with numbers taken from thin air) that the proportion > of C programmers or projects that actively choose C11 or C17 modes, as > distinct from using the compiler defaults, will be less than 1%. C99 > (or gnu99) is the most commonly chosen standard for small-systems > embedded programming, combining C90 libraries, stacks, and RTOS's with > user code in C99. So again, my preference is towards stricter > control, not more permissive tools. I don't think the estimate is accurate. Several upstream build systems I've seen enable -std=gnu11 and similar options once they are supported. Usually, it's an attempt to upgrade to newer language standards that hasn't aged well, not a downgrade. It's probably quite bit more than 1%. Thanks, Florian