The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx.manpages@gmail.com>
To: Dan Cross <crossd@gmail.com>
Cc: TUHS <tuhs@tuhs.org>
Subject: [TUHS] [TUHS]: C dialects (was: I can't drive 55: "GOTO considered harmful" 55th anniversary)
Date: Mon, 13 Mar 2023 13:43:52 +0100	[thread overview]
Message-ID: <d8b8561c-d4a9-cf09-59fb-6622c3ee161a@gmail.com> (raw)
In-Reply-To: <CAEoi9W4Z3-AZBDSF8iQaD3vc+=sxqwMfUmbxTW5HU90V5_ZXbA@mail.gmail.com>

Hi Dan,

On 3/13/23 13:19, Dan Cross wrote:
> On Mon, Mar 13, 2023 at 6:41 AM Alejandro Colomar (man-pages)
> <alx.manpages@gmail.com> wrote:
>> Or you can ask GCC to respect your view of the language with things like -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".

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.

  reply	other threads:[~2023-03-13 12:44 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-10 11:37 [TUHS] Re: I can't drive 55: "GOTO considered harmful" 55th anniversary Noel Chiappa
2023-03-10 11:51 ` [TUHS] Conditions, AKA exceptions. (Was: I can't drive 55: "GOTO considered harmful" 55th anniversary) Ralph Corderoy
2023-03-10 15:54 ` [TUHS] Re: I can't drive 55: "GOTO considered harmful" 55th anniversary Dan Cross
2023-03-12  7:39   ` Anthony Martin
2023-03-12 11:40     ` Dan Cross
2023-03-12 16:40       ` Paul Winalski
2023-03-13  3:25       ` John Cowan
2023-03-13 10:40         ` Alejandro Colomar (man-pages)
2023-03-13 12:19           ` Dan Cross
2023-03-13 12:43             ` Alejandro Colomar [this message]
2023-03-13 12:46               ` [TUHS] Re: [TUHS]: C dialects (was: I can't drive 55: "GOTO considered harmful" 55th anniversary) Dan Cross
2023-03-13 16:00               ` Paul Winalski
2023-03-13 19:00                 ` Clem Cole
2023-03-13 19:09                   ` Larry McVoy
2023-03-13 19:17                   ` Steve Nickolas
2023-03-13 20:26                     ` Dan Cross
2023-03-13 22:25                       ` Alejandro Colomar (man-pages)
2023-03-13 19:24                   ` [TUHS] Re: [TUHS]: C dialects Luther Johnson
2023-03-13 19:38                     ` Luther Johnson
2023-03-14 19:48                     ` John Cowan
2023-03-14 19:56                       ` Joseph Holsten
2023-03-14 20:01                       ` Luther Johnson
2023-03-13 20:48                   ` [TUHS] Re: [TUHS]: C dialects (was: I can't drive 55: "GOTO considered harmful" 55th anniversary) Paul Winalski
2023-03-13 20:56                     ` Bakul Shah
2023-03-14  1:06                     ` Larry McVoy
2023-03-13 21:00                   ` Paul Winalski
2023-03-13 21:07                     ` Bakul Shah
2023-03-13 21:14                       ` Dan Cross
2023-03-13 22:15                         ` Dave Horsfall
2023-03-13 22:47                           ` Dave Horsfall
2023-03-14  0:23                             ` Dan Cross
2023-03-14  0:21                           ` Dan Cross
2023-03-14 13:52                             ` Chet Ramey
2023-03-14  1:27                         ` Bakul Shah
2023-03-13 21:28                       ` Paul Winalski
2023-03-14 10:04                       ` [TUHS] C dialects Ralph Corderoy
2023-03-14 20:02                         ` [TUHS] " John Cowan
2023-03-14 21:34                           ` Thomas Paulsen
2023-03-14  0:38                     ` [TUHS] Re: [TUHS]: C dialects (was: I can't drive 55: "GOTO considered harmful" 55th anniversary) John Cowan
2023-03-14  2:49                 ` Theodore Ts'o
2023-03-14  3:06                   ` G. Branden Robinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d8b8561c-d4a9-cf09-59fb-6622c3ee161a@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=crossd@gmail.com \
    --cc=tuhs@tuhs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).