variable size array declarations

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

 



I am trying to check something in Smatch with variable size arrays
and I'm running into problems.  Here is the function I'm trying to
parse.

void func(int x)
{
	char buf[x];
}

Array symbols have an ->array_size.  It gets set correctly in parse.c
to expression of type EXPR_SYMBOL.  But by the time I parse it in
Smatch the ->array_size is now an EXPR_PREOP (a dereference).  In
fact all the variables seem to get change to dereferences of the
variables.

So if I have:
	char buf[a + b + *c + 4];
Smatch gets:
	char buf[*a + *b + **c + 4];

I'm not sure where this is getting changed or why.

regards,
dan carpenter

Attachment: signature.asc
Description: Digital signature


[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