public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Christopher Bazley <cs99cjb@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: _Optional: a type qualifier to indicate pointer nullability
Date: Sun, 5 Feb 2023 08:07:05 +0000	[thread overview]
Message-ID: <CAKBShRREvaqBQhvLvW0EF3DXNNPOAp94YxG_88jucBegHKKK4A@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdRWzmQYRj5HkOcAmy76e3Vr-yL_h04NHhGi3ewcq4EVaQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1725 bytes --]

On Sat, 4 Feb 2023 at 23:53, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:

>
>
> On Sat, 4 Feb 2023, 21:23 Christopher Bazley, <cs99cjb@gmail.com> wrote:
>
>>
>>
>> On Sat, 4 Feb 2023 at 20:40, Jonathan Wakely <jwakely.gcc@gmail.com>
>> wrote:
>>
>>>
>>> On Sat, 4 Feb 2023, 17:01 Christopher Bazley via Gcc, <gcc@gcc.gnu.org>
>>> wrote:
>>>
>>>>
>>>> Does the lack of support for Clang's nullability qualifiers in GCC
>>>> indicate
>>>> a greater likelihood for my proposed feature to be accepted into GCC?
>>>
>>>
>>> No, I don't think so. I think it would be better to support the same
>>> qualifiers as Clang, not diverge in this way.
>>>
>>
>> Clang’s _Nullable qualifier is broken and pretty useless (even according
>> to the code owner), so good luck with that.
>>
>
> But marking pointer arguments as non-null is already supported in GCC
> (with an attribute on the function, not the argument). Supporting a nonnull
> attribute on individual arguments seems useful to me. Far more than marking
> pointers as maybe-null, which is already true for all pointers.
>

Sorry, but I get the feeling that you didn’t read my article. If you could
spare the time, it would help you to understand where I’m coming from.
Saying “it’s already true that all pointers can be null [therefore there’s
no need for ‘_Optional’ in the type system]” is as facile as saying “it’s
already true that all values in Python can be None”.

I’d sooner trust Guido van Rossum on this question than Bjarne Stroustrup,
since the former actually *likes* C and uses it, whereas the latter
describes C as a perverse mess (and certainly doesn’t use it).
-- 
Christopher Bazley

  reply	other threads:[~2023-02-05  8:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-04 17:00 Christopher Bazley
2023-02-04 20:39 ` Jonathan Wakely
2023-02-04 21:22   ` Christopher Bazley
2023-02-04 23:52     ` Jonathan Wakely
2023-02-05  8:07       ` Christopher Bazley [this message]
2023-02-05 10:20         ` Jonathan Wakely

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=CAKBShRREvaqBQhvLvW0EF3DXNNPOAp94YxG_88jucBegHKKK4A@mail.gmail.com \
    --to=cs99cjb@gmail.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).