9front - general discussion about 9front
 help / color / mirror / Atom feed
From: mia soweli <inbox@tachibana-labs.org>
To: 9front@9front.org, Michael Forney <mforney@mforney.org>
Subject: [9front] Re: [9front] [PATCH] cc: support const and restrict inside array declarations
Date: Sun, 14 May 2023 11:23:12 +0100	[thread overview]
Message-ID: <51B24F80-9061-4A69-B48E-74C21346BD32@tachibana-labs.org> (raw)
In-Reply-To: <CAGw6cBukXPT7=pssiS=BJ8W6jGK+959=LOWUBmm0uJzNMGsKyw@mail.gmail.com>

in our c compilers, const, volatile, restrict, and noret fall under the same yacc rule "gname", so by allowing "zgnlist" in array brackets we would also end up allowing int a[noret 4].

it would need some changes to not allow this.

On 14 May 2023 09:10:23 BST, Michael Forney <mforney@mforney.org> wrote:
>On 2023-05-13, mia soweli <inbox@tachibana-labs.org> wrote:
>> this allows c23 style array declarations (see c23 draft section 6.7.6),
>> with type qualifiers inside the brackets.
>> for example:
>>
>> 	const int list[restrict 4];
>> 	int list[const 4];
>> 	int list[const restrict 4];
>> 	int list[volatile 4];
>> 	int list[noret 4]; /* we may not want to allow this */
>
>I have no idea what this is. Maybe you are thinking of noreturn? Even
>so, _Noreturn (what noreturn is defined as) is a function-specifier,
>not a type-qualifier, and is not allowed in the brackets of an array
>declarator in any C standard.
>
>>
>> they are ignored as with other uses of const, restrict, and volatile.
>> it does not allow
>>
>> 	int list[static 4];
>>
>> which is also allowed in c23.
>
>Just FYI, all of the above (except noret, which is nonsense) are valid
>in C99. I don't think any of this changed in C23.
>
>See http://port70.net/~nsz/c/c99/n1256.html#6.7.5.2

  reply	other threads:[~2023-05-14 10:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-13 23:31 mia soweli
2023-05-14  5:25 ` ori
2023-05-14 10:20   ` [9front] " mia soweli
2023-05-14  8:10 ` Michael Forney
2023-05-14 10:23   ` mia soweli [this message]
2023-05-14 11:10 ` [9front] [PATCH] cc: support type qualifiers inside array brackets mia soweli
2023-05-15  7:39   ` [9front] " mia soweli
2023-05-15 12:51     ` ori
2023-05-15 14:05       ` [9front] " mia soweli

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=51B24F80-9061-4A69-B48E-74C21346BD32@tachibana-labs.org \
    --to=inbox@tachibana-labs.org \
    --cc=9front@9front.org \
    --cc=mforney@mforney.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).