linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Array declarators not well diagnosed
@ 2007-05-02 13:59 Neil Booth
  0 siblings, 0 replies; only message in thread
From: Neil Booth @ 2007-05-02 13:59 UTC (permalink / raw)
  To: linux-sparse

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.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-05-02 13:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-05-02 13:59 Array declarators not well diagnosed Neil Booth

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).