9front - general discussion about 9front
 help / color / mirror / Atom feed
From: qwx@sciops.net
To: 9front@9front.org
Subject: Re: [9front] Re: cc: support binary constants and refactor
Date: Tue, 27 Jun 2023 23:57:50 +0200	[thread overview]
Message-ID: <06BB44D4C410A6B67D4C15A6D7D6B7BA@wopr.sciops.net> (raw)
In-Reply-To: <6029838c-c0b3-8956-8ac9-4638bef72241@posixcafe.org>

On Tue Jun 27 14:35:47 +0200 2023, moody@mail.posixcafe.org wrote:
> On 6/27/23 01:26, qwx@sciops.net wrote:
> > Hi all,
> > 
> >> Subject: [PATCH] cc: support binary constants and refactor
> >>
> >>
> >> C23 now specifies 0[bB] binary constants.
> >> In adding these cinap found that the bounds
> >> checking in mpatov() was incorrect, both in
> >> implementation and concept. So instead lets
> >> just accumulate the constant value as we lex.
> >
> > What's the motivation behind adding this?
> 
> I thought they were useful, saw they were being
> standardized, and the code change turned out quite small.
> That's the only reasoning.
[...]
> > Is it just for ports?
> 
> It was not added for any specific port. I added it because I thought they were
> useful.

Thanks; frankly I'm asking because I'm then a bit sceptical as to the
utility of this.  What I mean is that there are plenty of deficiencies
in C, but this seems like minor syntactic sugar; what else is it
alright to add, even if we don't have to care about compatibility etc?
But it's already in the tree, and I guess that's similar to adding
rc(1) features or syntax, and I don't complain about that, so
whatever.  I'm not sure I'm making sense here.


> > Either way, perhaps we should at least update 2c(1) to list
> > this and other non ANSI stuff that may have been added in the past few
> > years (noreturn, #pragma once recently).
> 
> Sure, something can be put in to 2c(1) regarding these, although a
> lot of these details hide out in /sys/src/cmd/cc/c99.

I think it's useful to have an up-to-date document to point to that
lists these kinds of additions.  I could perhaps go through the
changelog and write a patch when I find the time.

Anyway, thanks and cheers,
qwx

  reply	other threads:[~2023-06-27 22:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27  6:26 qwx
2023-06-27 12:38 ` Jacob Moody
2023-06-27 21:57   ` qwx [this message]
2023-06-28  0:15     ` Jacob Moody
2023-06-28  0:45       ` qwx
2023-06-28  1:28         ` Jacob Moody
2023-06-28  1:48         ` ori
2023-06-28  5:06           ` Noam Preil
2023-06-30 20:25             ` hiro

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=06BB44D4C410A6B67D4C15A6D7D6B7BA@wopr.sciops.net \
    --to=qwx@sciops.net \
    --cc=9front@9front.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).