From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) by sourceware.org (Postfix) with ESMTPS id 1D2E63858C54 for ; Fri, 12 May 2023 11:26:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1D2E63858C54 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=westcontrol.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=m.gmane-mx.org Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1pxQv8-0003Oj-3D for gcc@gcc.gnu.org; Fri, 12 May 2023 13:26:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gcc@gcc.gnu.org From: David Brown Subject: Re: More C type errors by default for GCC 14 Date: Fri, 12 May 2023 13:26:40 +0200 Message-ID: References: <87mt2behdl.fsf@yahoo.com> <57238276-5966-98d6-d5f0-f5451013ed17@gmail.com> <871qjned25.fsf@yahoo.com> <67e65b41-5400-d1c2-9f43-f94d0ea7da9b@gmail.com> <87wn1fcrw4.fsf@yahoo.com> <4d2af697-2f28-9e17-6b35-3a4ba19313d2@gmail.com> <87mt2ab8te.fsf@yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Content-Language: en-GB In-Reply-To: <87mt2ab8te.fsf@yahoo.com> X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_NUMSUBJECT,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 12/05/2023 04:08, Po Lu via Gcc wrote: > Eli Schwartz writes: > >> >> Because that's exactly what is going on here. Features that were valid >> C89 code are being used in a GNU99 or GNU11 code file, despite that >> ***not*** being valid GNU99 or GNU11 code. > > How GCC currently behaves defines what is valid GNU C. > What GCC /documents/ defines what is valid GNU C. (Much of that is, of course, imported by reference from the ISO C standards, along with target-specific details such as ABI's.) Anything you write that relies on undocumented behaviour may work by luck, not design, and you have no basis for expecting future versions of gcc, or any other compiler, to give the same lucky results. Each version of a compiler is, in fact, a different compiler - that is how you should be viewing your tools. The move between different versions of the same compiler is usually much smaller than moving between different compiler vendors, but you still look at the release notes, change notices, porting information, etc., before changing. You still make considered decisions, and appropriate testing. You still check your build systems and modify flags if needed. And you do that even if you are confident that your code is solid with fully defined behaviour and conforming to modern C standards - you might have a bug somewhere, and the new compiler version might have a bug. >> I am not dictating anything to you or anyone else in this paragraph, >> though? All I said was that if one writes a c89 program and tells the >> compiler that, then they will not even notice this entire discussion to >> begin with. >> >> What, precisely, have I dictated? > > That people who are writing GNU C code should be forced to rewrite their > code in ANSI C, in order to make use of GNU C extensions to the 1999 > Standard. > You are joking, right? Surely no one can /still/ be under the misapprehension that anyone is proposing GCC stop accepting the old code? All that is changing is the default behaviour, which will mean some people might have to use an extra flag or two in their build setup. > >> However, it does appear that we are still stuck in confusion here, >> because you think that GCC is no longer able to compile such code, when >> in fact it is able to. > > It won't, not by default. > That's pretty much irrelevant. People don't use gcc without flags. The only thing that will change is which flags you need to use. If you are not in a position to change the source code, and not in a position to change the build flags, then you are not in a position to change the compiler version. (That's fine, of course - in my line of work, I almost never change compiler version for existing projects. I have old code where the makefile specifies gcc 2.95.) David