Re: [PATCH v2 04/16] add testcases for type attributes

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

 



On Mon, Dec 28, 2020 at 04:13:54PM +0000, Ramsay Jones wrote:
> On 26/12/2020 17:51, Luc Van Oostenryck wrote:
> > diff --git a/validation/type-attribute-qual.c b/validation/type-attribute-qual.c
> > new file mode 100644
> > index 000000000000..ab19a605bda1
> > --- /dev/null
> > +++ b/validation/type-attribute-qual.c
> > @@ -0,0 +1,12 @@
> > +static const struct s {
> > +	int x;
> > +} map[2];
> > +
> > +static void foo(struct s *p, int v)
> > +{
> > +	p->x += v;
> > +}
> 
> Hmm, I don't understand what this is testing! :(

The declaration of map also contains the definition of 'struct s'.
The test, by tryin to modify something of type 'struct s', allows to
verify that the 'const' applies only to 'map' and not to 'struct s'.

I'll add a comment.
-- Luc



[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