From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Cc: Joe Perches <joe@perches.com>,
Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>,
linux-sparse@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] compiler*.h: Add '__' prefix and suffix to all __attribute__ #defines
Date: Tue, 29 Oct 2019 18:54:00 +0000 [thread overview]
Message-ID: <ede574e5-d18d-f30c-b9f0-a39b73d57ff3@ramsayjones.plus.com> (raw)
In-Reply-To: <20191029080701.qpvscbz3xptadhbd@ltop.local>
On 29/10/2019 08:07, Luc Van Oostenryck wrote:
> On Tue, Oct 29, 2019 at 02:38:54AM +0000, Ramsay Jones wrote:
>> On 28/10/2019 23:03, Luc Van Oostenryck wrote:
>>> diff --git a/parse.c b/parse.c
>>> index 4464e2667..4b0a1566c 100644
>>> --- a/parse.c
>>> +++ b/parse.c
>>> @@ -345,6 +345,7 @@ static struct symbol_op goto_op = {
>>>
>>> static struct symbol_op __context___op = {
>>> .statement = parse_context_statement,
>>> + .attribute = attribute_context,
>>
>> Hmm, so why is do we have a context_op and a __context___op?
>>
>>> };
>>>
>>> static struct symbol_op range_op = {
>>> @@ -537,6 +538,7 @@ static struct init_keyword {
>>> { "while", NS_KEYWORD, .op = &while_op },
>>> { "do", NS_KEYWORD, .op = &do_op },
>>> { "goto", NS_KEYWORD, .op = &goto_op },
>>> + { "context", NS_KEYWORD, .op = &context_op },
>>> { "__context__",NS_KEYWORD, .op = &__context___op },
>>
>> So, can '__context__' be used in a statement, as well as an
>> attribute, while 'context' can only be used in an attribute?
>
> Yes, indeed.
OK, so I wasn't quite as confused as I thought! ;-)
> '__context__' was only parsed as a statement and 'context'
> only as an attribute. But now we also want to be able to use
> '__context__' as an attribute (because 'context' is not a
> reserved keyword and can thus be a used defined macro).
>
> There is no reason, though, we should now also want to use
> 'context' as a statement since it's a sparse extension. Hence
> adding attribute_context to '__context___op' and keeping
> 'context_op' as such (but moving them together).
Thanks for the explanation.
ATB,
Ramsay Jones
prev parent reply other threads:[~2019-10-29 18:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <7a15bc8ad7437dc3a044a4f9cd283500bd0b5f36.camel@perches.com>
[not found] ` <CANiq72=B6XKwfkC9L4=+OxWtjxCp-94TWRG1a=pC=y636gzckA@mail.gmail.com>
2019-10-28 17:59 ` [PATCH] compiler*.h: Add '__' prefix and suffix to all __attribute__ #defines Joe Perches
2019-10-28 18:17 ` [PATCH V2] " Joe Perches
2019-10-28 22:15 ` [PATCH] " Luc Van Oostenryck
2019-10-28 22:28 ` Joe Perches
2019-10-28 23:03 ` Luc Van Oostenryck
2019-10-29 2:38 ` Ramsay Jones
2019-10-29 8:07 ` Luc Van Oostenryck
2019-10-29 18:54 ` Ramsay Jones [this message]
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=ede574e5-d18d-f30c-b9f0-a39b73d57ff3@ramsayjones.plus.com \
--to=ramsay@ramsayjones.plus.com \
--cc=akpm@linux-foundation.org \
--cc=clang-built-linux@googlegroups.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=miguel.ojeda.sandonis@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 NNTP newsgroup(s).