From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 27434 invoked from network); 13 Mar 2023 12:47:26 -0000 Received: from minnie.tuhs.org (50.116.15.146) by inbox.vuxu.org with ESMTPUTF8; 13 Mar 2023 12:47:26 -0000 Received: from minnie.tuhs.org (localhost [IPv6:::1]) by minnie.tuhs.org (Postfix) with ESMTP id 1841B413A9; Mon, 13 Mar 2023 22:47:23 +1000 (AEST) Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by minnie.tuhs.org (Postfix) with ESMTPS id E7982413A2 for ; Mon, 13 Mar 2023 22:47:15 +1000 (AEST) Received: by mail-lf1-x135.google.com with SMTP id i28so15595887lfv.0 for ; Mon, 13 Mar 2023 05:47:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678711634; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=g2osbfgWEuffbDdVFKqO7kKGkt981hMYaaZXPk+gpRg=; b=J89z9WI7qNy5Lyy9bnhX7nVCJoCxrwfMd+crkBNVaLO8hsQb4aHOdzGzhy0YdzjqGm zk/ZZiAibljxYtjvDzwMo9OLy/5DxhRrLUIc+T/QuK1IOJMIVTwD5J89z1k8iTXw2gcU d83YpgPuKZLTl9kxqKcBR5tnagjw/tMrWy9Micw5zKzjCDXpr37L9P+RzvZRTuBF6UW7 kL1bMS7thETLqohJppgSZGMtdijod9vCzhpgkyMJOIl2gcbfaSIRG3xn/tu9DmCQHXSO 0XEt4pnfV3Pwucw1KGKlcOEiUKCLahMWZRt4e9/kfbT23X2o7mTJo863ickvhiHOS96/ ++fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678711634; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g2osbfgWEuffbDdVFKqO7kKGkt981hMYaaZXPk+gpRg=; b=polhe6cciGYcTbPIWQ45MgSSn9QxbASDflbl9NZY9OwjyT4/pb5vKQFSF3df2hNW02 fzsuNxoV7DFKCgYwrEGZGpniho6H8OUDVcfOiRTxHNK90sM8vqke0Khw+4zix/TJhVIj L36HvygEjQUP6wLrGa04thJ2jJL0Zh5RbB6HtaWXXohybsbrrpY/MlRVOxlSLt05+F8V b+4ociKyIBnoCm1e7scr1Q5+vnibd8rclk3zXJsHkKYdyeD5RUgmUoppWr9jZQs1ojjT xbMYx+tTO6LSl4eAPOOQ0uccDQmDXDUIa7FB/maW7/44GOmjpYpPzRAIbEqLHKfUewYu QlUQ== X-Gm-Message-State: AO0yUKVmRFDyFAQIE4qUhySqqxU8nG3QugXFTbRH1+xHRULAPIXmwNhn LjCF5IrmSPfESpL0MW5E/Ovt2oe24sUKBIasqnk= X-Google-Smtp-Source: AK7set8RzYgKumFLziG/J2Tzyi5j4GuHULxfQdHm7KmAbwmHoGyrf/1oQNYHGFNWf6YzIVHgtwJMdhZadKN4OG3ZejA= X-Received: by 2002:ac2:5927:0:b0:4d5:ca32:6aec with SMTP id v7-20020ac25927000000b004d5ca326aecmr10321087lfi.12.1678711633848; Mon, 13 Mar 2023 05:47:13 -0700 (PDT) MIME-Version: 1.0 References: <20230310113708.AD55518C080@mercury.lcs.mit.edu> In-Reply-To: From: Dan Cross Date: Mon, 13 Mar 2023 08:46:37 -0400 Message-ID: To: Alejandro Colomar Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Message-ID-Hash: J7BCDAJLEMNGTEO7CDVD2AKLGF2SI4TQ X-Message-ID-Hash: J7BCDAJLEMNGTEO7CDVD2AKLGF2SI4TQ X-MailFrom: crossd@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: TUHS X-Mailman-Version: 3.3.6b1 Precedence: list Subject: [TUHS] Re: [TUHS]: C dialects (was: I can't drive 55: "GOTO considered harmful" 55th anniversary) List-Id: The Unix Heritage Society mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Mon, Mar 13, 2023 at 8:43=E2=80=AFAM Alejandro Colomar wrote: > On 3/13/23 13:19, Dan Cross wrote: > > On Mon, Mar 13, 2023 at 6:41=E2=80=AFAM Alejandro Colomar (man-pages) > > wrote: > >> Or you can ask GCC to respect your view of the language with things li= ke -fno-strict-aliasing, -fwrapv, and -fno-trapv. > > > > The problem that is that you are then no longer programming in "C", > > but rather some dialect of "C" that happens to share the same syntax, > > but with different semantics. That may be fine, or it may not, but it > > can lead to all sorts of footgun traps if one is not careful. > > Well, it depends on what you call "C". There are many dialects, > and I'm not sure there's any which I'd call "C". That's precisely the problem. :-) - Dan C. > The 3 main dialects are "ISO C", "GNU C", and "K&R C". And then > there are subdialects of them. We could say "C" is "ISO C", since, > well, it's _the_ standard. But then, ISO C shares the aliasing > issues that GNU C has, so by avoiding the GNU C compiler you're > not avoiding the issues we're talking about; moving to a compiler > that only talks ISO C is going to keep the issues. You'll need > a compiler that talks K&R C, or some other dialect that doesn't > have aliasing issues. > > At that point, since you already need a subdialect of C, GCC is > one such compiler, since it provides a comprehensive set of flags > to tune your dialect. > > Or you could move to a compiler that talks its own dialect > (probably some subdialect of K&R C, as I expect Plan9 C is, but > I never tried it). But that's not much different from asking > such dialect to GCC. > > Cheers, > > Alex > > > > > - Dan C.