Array declarators not well diagnosed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux