From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Lance Richardson <lrichard@redhat.com>
Cc: Linux-Sparse <linux-sparse@vger.kernel.org>
Subject: Re: bit-field notation and k&r function syntax
Date: Thu, 4 May 2017 01:07:22 +0200 [thread overview]
Message-ID: <20170503230721.vb4aunmpaa2xxaf2@desk.local> (raw)
In-Reply-To: <571546431.4485670.1493831412428.JavaMail.zimbra@redhat.com>
On Wed, May 03, 2017 at 01:10:12PM -0400, Lance Richardson wrote:
> I noticed when browsing parse.c that function parameters declared
> using K&R syntax are parsed by calling declaration_list(), which
> seems to have been intended for parsing structure member declarations
> and accepts bit-field syntax.
>
> So e.g. this is (incorrectly) accepted by sparse:
>
> static int foo(b)
> int b: 4;
> {
> return 0;
> }
Hmmm yes.
What's sparse use 'declaration_list()' for is not what correspond
to the standard's 'declaration-list' but is indeed for something
that should be reserved to structs.
Nice catch.
-- Luc
next prev parent reply other threads:[~2017-05-03 23:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1231012108.4484627.1493830970281.JavaMail.zimbra@redhat.com>
2017-05-03 17:10 ` bit-field notation and k&r function syntax Lance Richardson
2017-05-03 23:07 ` Luc Van Oostenryck [this message]
2017-05-04 1:50 ` Christopher Li
2017-05-04 2:14 ` Luc Van Oostenryck
2017-05-04 3:20 ` Christopher Li
2017-05-04 15:07 ` Luc Van Oostenryck
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=20170503230721.vb4aunmpaa2xxaf2@desk.local \
--to=luc.vanoostenryck@gmail.com \
--cc=linux-sparse@vger.kernel.org \
--cc=lrichard@redhat.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).