From: Yair Lenga <yair.lenga@gmail.com>
To: gcc@gcc.gnu.org
Subject: [RFC] Support for nonzero attribute (Miika)
Date: Wed, 8 Jun 2022 11:02:31 -0400 [thread overview]
Message-ID: <CAK3_KpOKs1DqaH2iuRCuZ5DBesrADZrCD7wg+v+OHDOwG=A=dg@mail.gmail.com> (raw)
Miika - lot of thanks. In .y mind, this is a major improvement.
Also, want to suggest taking a nother look into the semnatic. I agreed
inrange should include the low and high, similar to the gcc extensions) ..
operator, the SQL in operator, perl .. operator, etc.
There is another use common use case: creating a variable that can be used
to index an array. With the inrange:
Double a[MAX_ELEM];
Int ia __attr__((inrange(0, (sizeof(a)/sizeof(a[0]))) ;
One trivial solution will be to define a macro
#define array_index(a) int __attr__((inrange(0, (sizeof(a)/sizeof(a[0])))
And then we can do:
Array_index(a) ia;
which I think is very cool.
Yair
reply other threads:[~2022-06-08 15:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='CAK3_KpOKs1DqaH2iuRCuZ5DBesrADZrCD7wg+v+OHDOwG=A=dg@mail.gmail.com' \
--to=yair.lenga@gmail.com \
--cc=gcc@gcc.gnu.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 read-only IMAP folder(s) and NNTP newsgroup(s).