From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sonic307-56.consmr.mail.ne1.yahoo.com (sonic307-56.consmr.mail.ne1.yahoo.com [66.163.190.31]) by sourceware.org (Postfix) with ESMTPS id 36D783858D33 for ; Thu, 11 May 2023 08:31:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36D783858D33 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=yahoo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683793907; bh=cnIC576FXJ3v78sYDYWbsHc6qQxr42tcrVNvak07DnM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=ZNsJyxxGcBilIT5214aTiqhO0V/s5uBoaAOAq8Xzf2POTAiLCD6lQ7wOXqrh3kgNdwJyIgHqSHdLdbxp9edx2AbutTQhYGY75usW5U0U5NVTbSZOUK7LBRRGKuZqG/1XBXM0Rd9Jmmj9+vgyAPWx6XMM9JsS2tT9ceXeXaHNs61eJULFHE78ahCzlgPrszBsh49LtIcJfnr0+godaNYCsiTf7QhHGqBURC8QQXECAtquX0zQgOYNjPpV8HhCO5DjoBnfj5XVcXWg6ZMu0h26mHm9usrCfjQIYC74rLjyecbmmoasIMBAThcw6CEkldmjf8qhZX6De6V197D7vCkcyg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1683793907; bh=iVaxuzXlbTQMzNxqXjb1XzoCUxQcgg5fjWQoUrp1YVA=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=ELc6FfTqm8co9+utsLr2xNFtushkMesr2asTa+D7Tgu2w8i+eVxIzuBKR5RptVNYAAsSAjJH7XkVgP7z9C675DXAmv5X9TUQHuzrMn1vxbePuXf2HJ2X0WS28lT6cIaRDul9Y3HtytgxItQjr1QDeuDPxugu0r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GyvoGikWnCcorJrHNmO8Tz5 3AyO76r6s_c3TbEj9VyhdSHV_0zS.hQDEiHYXHzQJIKfT63AzlPskjfZnpMY6xQ4lZcaihPhd0OG e6hiGubLk6A.sHF8L2Nsg.Hy__m0AoldC3vb71wG7gqJcp7bKFypO2Cq7pcJqRDyf0IIVJcfRxjd 4ucZsck7xBsZQJIa.FzuN1ojt3UbxGHXbXadUNJk00OWaddKDtngaFcX.EW4lVnuNJ_FLmIoSRT_ f9W5k3QXSiUiR7ZIdNOKbLWa4zc7wWs29Ja9y4JPfgGKkoTXg_NNWmvpbELmi6V9SALuM6POr6IL 4NwLemCsMDKHdcy5JYvvlNfP6X..cAXPnLXQTatAaDJt4xFUX5eweCFH091ij0rxgzbId1Bw- X-Sonic-MF: X-Sonic-ID: 60f6b76f-649c-460f-abcd-b21ab4750ca8 Received: from sonic.gate.mail.ne1.yahoo.com by sonic307.consmr.mail.ne1.yahoo.com with HTTP; Thu, 11 May 2023 08:31:47 +0000 Received: by hermes--production-sg3-748897c457-ppt9c (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 706389183a29f754519895b78e2f7819; Thu, 11 May 2023 08:31:40 +0000 (UTC) From: Po Lu To: Arsen =?utf-8?Q?Arsenovi=C4=87?= Cc: Jonathan Wakely , gcc@gcc.gnu.org Subject: Re: More C type errors by default for GCC 14 In-Reply-To: <865y8zmi08.fsf@aarsen.me> ("Arsen =?utf-8?Q?Arsenovi=C4=87?= =?utf-8?Q?=22's?= message of "Thu, 11 May 2023 09:38:59 +0200") References: <877cth66qb.fsf@oldenburg.str.redhat.com> <20230509102201.6aa2a7d14fdb2f1e7abff449@killthe.net> <87r0rp5uf8.fsf@aarsen.me> <83ttwla1ep.fsf@gnu.org> <83lehx9vix.fsf@gnu.org> <83fs859unu.fsf@gnu.org> <87y1lx1avj.fsf@oldenburg.str.redhat.com> <83ednoapb6.fsf@gnu.org> <875y8zegnc.fsf@yahoo.com> <865y8zmi08.fsf@aarsen.me> Date: Thu, 11 May 2023 16:31:36 +0800 Message-ID: <87bkirclqv.fsf@yahoo.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Mailer: WebService/1.1.21471 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo X-Spam-Status: No, score=0.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,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: Arsen Arsenovi=C4=87 writes: > Good. The above code is nonsense, the chances that foo will be > incorrectly called are high. Yet lint (or scrutiny, as should be performed with any declaration, implicit or not) makes sure that does not happen. > What is this meant to produce? It was just an example. I'm not allowed to show any real code. > This is, at best, a "works by coincidence", rather than being code > anyone should be writing. See what I said about being the judge, jury and executioner. (BTW, I thought implicit int was being discussed, not implicit function declarations, but here goes.) The same problems will appear with _any_ extern declaration. If you remove implicit function declarations, people will simply paste: extern int foo (); above the code which no longer compiles. Or, if you force everyone to use prototypes, extern int foo (char *); You will not be able to diagnose whether or not this declaration is correct, because the definition will lie in another translation unit. Except that in this case, no diagnostic will be issued at all when the declared function is called. The only place where you can truly fix mismatched declarations is the linker (or collect2?) GCC proper cannot do anything about it. > Such code is already written, when building it, pass -fpermissive. > You benefit from the error otherwise. > > (and no, this isn't an issue of style, the code in question *does not* > convey sufficient information for the compiler to always do the right > thing) It does on reasonable machines for which the code was written. I gave two examples. Perhaps the 386 is another.