linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Booth <neil@daikokuya.co.uk>
To: linux-sparse@vger.kernel.org
Subject: Array declarators not well diagnosed
Date: Wed, 2 May 2007 22:59:13 +0900	[thread overview]
Message-ID: <20070502135913.GA917@daikokuya.co.uk> (raw)

I have a small and woefully incomplete conformance testsuite (C90
and C99), compile-time logic only, that I've been gradually building
up.  I'm keeping it to myself for now.  I thought I'd run sparse on it.
It has both positive and negative tests, i.e., things that should be
accepted are compiled successfully, and things that should be diagnosed
are diagnosed.

Of course, I realise sparse isn't really intended to be a conforming
compiler and AFAIK you can't even switch between C90 and C99.  As
such I had difficulty finding appropriate switches; I chose to run
"sparse" with -W and -Wall with anything sent to stderr indicating
a diagnostic.  Let me know if something is more appropriate.

Anyway, under these admittedly poor conditions for C90, sparse
failed 47 of 959 tests, which isn't bad.  Some of these will be
logical duplicates (i.e. testing essentially the same thing in
different circumstances; if the thing being tested isn't implemented
at all it'll fail several tests).  For comparison GCC fails 5 of
them.

Here are some failures regarding array declarators that
someone may be interested in.  All should be diagnosed but are not.

extern int a[2][];

struct b
{
  struct b c[2];
};

int c[-1];

Neil.

                 reply	other threads:[~2007-05-02 13:59 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=20070502135913.GA917@daikokuya.co.uk \
    --to=neil@daikokuya.co.uk \
    --cc=linux-sparse@vger.kernel.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).