Please make "no member" error more informative

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

 



Hello!

sparse reports the same error for two different situations.  Suppose
file test.c is:

struct ctl_table {
	int foo;
};

void test(struct ctl_table *sc)
{
	sc->ctl_name = 0;
}

$ sparse -Wall test.c 
test.c:7:4: error: no member 'ctl_name' in struct ctl_table

Rename the first ctl_table to ctl_table1, and the error will be the
same.

In the first case, the structure is known and lacks the requested
member.  In the second case, the structure is unknown.

I'll appreciate if somebody makes the messages different.  The message
is printed in evaluate_member_dereference() in evaluate.c.

Please test the case when only a forward declaration is available.  This
should be reported like the undeclared case.  Another test case is a
structure with no members.  It should be treated as declared.

-- 
Regards,
Pavel Roskin

-
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