From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id B495F3858C54 for ; Fri, 12 May 2023 11:05:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B495F3858C54 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-965d2749e2eso1441606566b.1 for ; Fri, 12 May 2023 04:05:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683889552; x=1686481552; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=m+vJxlqoqd7MgpP+LKaIQmkoAuHqBZG0uTIau29aVjU=; b=Us1FBp2YKivymVXYs8bd3yq8iHBj/yDuVk7ktOq28sE8ZrkbMunLObZdqdHtmQKGv6 Oum/UuyZNjswZipFA+lc0cziuAEyP573qalkOzlkpPW1FoI67L+4XBJiGcRHeKomvp1p nIQkxpDqgrpkKQdcKBtnR+wLijAUT3QaeNyykU6DiNgokdeR7hdbQoceusrezYaygR91 4TyP60YvXVMvAFceWhQNtqzuLARe3mBqg7tIfXIhHsD9fqiUJ8q+mWbOOYYJ0W8swxsT EtsDRymbaPsb4vmaHQw0mfSbXMAmC5XOyunCEMMEIrvN73EQNPwbvTbkMpFnp5lvBJdu 4aBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683889552; x=1686481552; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=m+vJxlqoqd7MgpP+LKaIQmkoAuHqBZG0uTIau29aVjU=; b=gfOE5lbS4tRS3th+LBekK/JATSgFCeVQC17mlOwq9cZyxbNXtJP1sBuFOVEnSaiG7Q Q9NW7E9U2B+JcP4cNU2zvO+kxzbuSIbugblMNmFbvLQl2KVtIVPypAOzuhvHkIosJPPo D6DcwtL/jU7mAE+s1y91muqcuJM0N7C59Snd5LjnQIbz93yFjd9hvD98IV9q2W1jzLnd 6SF2v8LmYxJpfwzWh/X/5/3et0W+aut1rJKavQcb0lfBgs7DYJln7FeyQzkqzTd53SsD 7Ygcj0TGO5P4UJrVpuUALj55+JCO+xUTVoAIoxKQbVB3fx25o4EHJ93igEV973VbVtOK +OeQ== X-Gm-Message-State: AC+VfDzSEitPqeK2FbVDRJxu8H3BL/5p1kr6IT8Jzhs1Wth8XVevMBUn s9NGSTZ783Qg1B8Uv8ehtbc= X-Google-Smtp-Source: ACHHUZ67lMYRG4MIzp9/MFkSVgcINt9aBI1Rn6J54XS1DGw0I5hlfS6reEkpxybbPC3eTwAfrY7fRQ== X-Received: by 2002:a17:907:9694:b0:969:ba95:a3a0 with SMTP id hd20-20020a170907969400b00969ba95a3a0mr14379290ejc.23.1683889551901; Fri, 12 May 2023 04:05:51 -0700 (PDT) Received: from [10.31.0.11] ([194.126.177.88]) by smtp.gmail.com with ESMTPSA id e26-20020a170906845a00b00965cd15c9bbsm5320273ejy.62.2023.05.12.04.05.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 May 2023 04:05:51 -0700 (PDT) Message-ID: Date: Fri, 12 May 2023 13:05:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: More C type errors by default for GCC 14 Content-Language: en-US To: Po Lu , Eli Schwartz Cc: gcc@gcc.gnu.org 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> <87h6si9jn0.fsf@yahoo.com> From: Gabriel Ravier In-Reply-To: <87h6si9jn0.fsf@yahoo.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: On 5/12/23 07:57, Po Lu via Gcc wrote: > Eli Schwartz writes: > >> There are ***not*** thousands of Makefiles that have this issue. But if >> there were, then Makefiles are very easy to update, and only have to be >> updated once per project, not thousands of times. So this is fine. You >> may have to update your Makefile, but that is no big deal. >> >> It's still no big deal, no matter how much you dramatize the intensity >> of adding a flag to your Makefiles. > It's extra work. Why don't I just write: > > extern int foo (); > > above each of the new errors? > That is just about what anyone will do when confronted by these new > errors. As a result, you have not ensured that any declarations are > correct, but instead you have annoyed a lot of people and lulled > yourself into a false sense of safety. It's "extra work" to add 10 characters to a Makefile, but normal to add random faulty declarations everywhere ? I could only imagine someone doing this if they're being either extremely uninformed, extremely restricted (e.g. no change to any configuration files, no pragmas to disable the errors and not even having 10 seconds to look up the correct function prototype) or deliberately obtuse. > >> So you concede that GCC is not telling you, only trying and failing to >> tell you? > I concede that you're playing with words. > >> Great, so what's the problem? If GCC can't actually enforce it, and even >> goes out of its way to offer you options to ignore what it's telling you >> to do, then maybe... >> >> ... it's not telling you what to do with your code, only suggesting what >> to do? >> >> So ignore the suggestion. > Which is made annoying, especially when there is absolutely NO guarantee > being made that the new option will stay. > >> I'm not sure what this semantics game here is trying to say. Is it >> ethically and morally wrong for GCC to try to tell you what to do with >> your code? Is it undignifying to have a mere machine go and lecture you, >> a real human being with a consciousness and free will, what to do? >> >> Because if that's what this is about then I think you are taking this >> inanimate object way too personally. >> >> If not, then I am simply entirely unsure what your objection is to being >> "told". >> >> >>>> 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. >> >> No. Absolutely positively 100% no under any circumstances whatsoever no. >> >> This has been explained multiple times by the GCC developers. e.g. >> search for references to accepts-invalid. >> >> """ >> They are bugs where compiler accepts something that isn't valid in >> the selected language nor considered valid extension. >> So, after the fix we reject something that has been accepted before. >> >> In the last few years (checked what was fixed in 10/11/12/13 releases so >> far), we've fixed 12 such bugs explicitly marked that way: >> """ > The Standard states that each conforming implementation must be > accompanied by a document which documents each and every extension. > > This document is the GCC manual, which makes reference (not too clearly, > however, which should be fixed) to both implicit int and implicit > function declarations, which are allowed in C99 and later dialects of C. > > These constructs are not bugs. These constructs explicitly defined by > GNU C; since a diagnostic is issued, GNU C's implementation also > conforms to the Standard. > >> You cannot, and are not permitted, to define "how GCC currently behaves" >> as "defines what is valid GNU C". No one agrees with your analysis. Most > ^^^^^^ > > I'm not a person? Now you're the one playing with words. That, or you have a complete lack of understanding of extremely common English expressions, which you may want to work on as you will otherwise inevitably have large problems effectively communicating anything with people on this list. > >> importantly, GCC does not agree with your analysis. > For some definition of GCC, which is apparently you. The "definition of GCC" used here is in a more general sense, i.e. the GCC project and the people involved in it that would be considered generally representative of it. In fact, so far on this thread I've seen almost nobody on your side of the argument, save for a very few extremely loud people repeating the same arguments over and over. So far I've seen only a single minor GCC contributor arguing the behavior should be kept as-is - pretty much everyone else agrees the behavior should be changed. In fact, I've talked to many people who are not currently posting in this thread, who consider that the default should be changed, and are watching in consternation as a few people appear to be trying to hold back the entire community with extremely bad defaults. > >> It's a wild, wild, wild claim to begin with. You are arguing that any >> bug, ANY bug whatsoever, which qualifies for the title "how GCC >> currently behaves" because if a bug is currently present, then GCC >> currently behaves in a buggy manner... >> >> ... any such bug is, ***because*** GCC currently does it, now part of >> the documentation on "GNU C", a language dialect with documentation. >> >> Can you show me where on >> https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html the GCC >> documentation states that "C Extensions include anything that GCC >> currently does, no matter what, no matter how documented or undocumented"? > I see: > > `-Wno-implicit-int (C and Objective-C only)' > This option controls warnings when a declaration does not specify a > type. This warning is enabled by default in C99 and later dialects > of C, and also by `-Wall'. > > `-Wno-implicit-function-declaration (C and Objective-C only)' > This option controls warnings when a function is used before being > declared. This warning is enabled by default in C99 and later > dialects of C, and also by `-Wall'. The warning is made into an > error by `-pedantic-errors'. In the "C Extensions" section ? >> The concept of a language extension has bulletproof meaning. You cannot >> get around it, redefine it, pretend that something is when it isn't, or >> otherwise disagree with this bulletproof meaning. > The concept of a ``language extension'' is not defined anywhere. > Instead, there are three kinds of behavior not precisely specified by > the Standard: > > - undefined behavior, the behavior upon use of an erroneous construct > for which the Standard imposes no requirements whatsoever. > > - unspecified behavior, where upon the use of a construct for which > the Standard imposes two or more possible behaviors, and leaves the > selected behavior unspecified. > > - implementation-defined behavior, unspecified behavior where each > implementation documents how the choice is made, and is required to > document that choice. > > If the translator precisely defines either undefined behavior (in this > case, erroneous syntax) or unspecified behavior, then that definition is > commonly considered to be an extension of that translator. Nothing > gcc.info says will change that. > >> The compiler defines an extension by writing about it in its >> documentation on "GNU C extensions". >> >> Anything else you have to say on the topic is automatically wrong. >> >> Language has meaning. *Words* have meaning. The word "extension" has a >> very specific meaning in the GCC documentation. You can read all about >> it, here: https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html > GNU C documentation does not decide what is an extension and what is > not. In any case, if (gcc)C Extensions does not mention extensions > currently implemented by GCC, then that is a bug in the documentation, > is it not? Documentation is supposed to reflect what the program being > documented does, not the other way around. Like the Standard says: > > An implementation shall be accompanied by a document that defines all > implementation- defined and locale-specific characteristics and all > extensions. By the same line of argumentation, any accepts-invalid is actually not a bug and should instead be considered a documentation bug that should be fixed by altering the documentation rather than fixing the actual bug (given that you appear to consider that making GCC not accept code that it previously accepted by default is something that should never be done). I hope you understand that's not a reasonable line of argumentation. >> I did not dictate that you have to rewrite your code. You are replying >> to something that has no relationship whatsoever to any form of >> instruction, telling, or even ***advice***, and calling it dictation. I >> reiterate: this paragraph was me ***observing*** a fact. That fact is >> that if someone happens to do X, then they will not be affected by this >> discussion. >> >> (X is, in this case, "someone wrote ANSI C code and also chose to use a >> flag telling the compiler that it is ANSI C".) >> >> >> But, furthermore, I would like to now clarify something anyway. >> >> You are not writing GNU C code, you never have been. GNU C code is >> defined by the documentation for GNU C: >> https://gcc.gnu.org/onlinedocs/gcc/C-Extensions.html >> >> You may take this as me dictating to you that you are not to call this >> code "GNU C". > Really? Then why is __GNUC__ defined, and why does it compile with > `gcc'? To be honest, I'd be inclined to consider the current behavior a longstanding bug that's been wrongly considered to be a WONTFIX for many years, and that we're only now getting around to fixing, if you really want to go down this line of argumentation. > >> My opinion on this is (still) that if your argument is that you don't >> want -fpermissive or -std=c89 to be removed, you are more than welcome >> to be skeptical about that (either one or both), but I don't see why >> that is on topic for the question of whether things should be moved to >> flags such as those while they do exist. >> >> If they want to remove -fpermissive, or -std=c89, out of an >> unwillingness to provide compilers capable of being instructed to accept >> and compile your coding style, then they will do so regardless of this >> conversation. >> >> We might as well assume that the GCC developers are honest and truthful >> people, otherwise it is *definitely* a waste of time asking them about >> this change in the first place. > How honest and truthful they are does not reflect whether or not the > proposed new option will be kept around. In fact, I observe that none > of them have committed to supporting such an option indefinitely. Actually, now that I think about it, what are you actually trying to get from this conversation ? If you're unsatisfied with a lack of commitment from the maintainers to maintain a `-fpermissive` option indefinitely, it seems like you can't possibly be satisfied with the current situation, either. It seems like what you actually want is an eternal commitment from the GCC developers to never ever change the behavior of GCC ever in any way that could ever break any of your old broken code...