Re: more spewage (Re: sparse segfault on ppc64)

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

 



On Sat, 24 Mar 2007 00:31:27 +0100 Sam Ravnborg wrote:

> > 1.  net/sched/cls_api.c, lines 593-611:
> > 
> > 	return 0;
> > rtattr_failure: __attribute__ ((unused))
> > 	return -1;
> > }
> > 
> > ...
> > 
> > 	return 0;
> > rtattr_failure: __attribute__ ((unused))
> > 	return -1;
> > }
> > 
> > These spew:
> > 
> > net/sched/cls_api.c:593:17: error: typename in expression
> > net/sched/cls_api.c:594:2: error: Expected ; at end of statement
> > net/sched/cls_api.c:594:2: error: got return
> > net/sched/cls_api.c:611:17: error: typename in expression
> > net/sched/cls_api.c:612:2: error: Expected ; at end of statement
> > net/sched/cls_api.c:612:2: error: got return
> > net/sched/cls_api.c:593:17: error: undefined identifier '__attribute__'
> > net/sched/cls_api.c:611:17: error: undefined identifier '__attribute__'
> > 
> > 
> > 2.  in 2.6.21-rc4-mm1 only AFAIK, arch/x86_64/kernel/early-quirks.c, #79:
> > 
> > static struct __initdata chipset early_qrk[] = {
> > 	{ PCI_VENDOR_ID_NVIDIA, nvidia_bugs },
> > 	{ PCI_VENDOR_ID_VIA, via_bugs },
> > 	{ PCI_VENDOR_ID_ATI, ati_bugs },
> > 	{}
> > };
> In this case it is only good that sparse complains because the
> __initdata is not placed right before the variable name as it should be.

That one is quite ugly IMO.  I'm surprised that a compiler
parses it.

> You could argue that the error from sparse could be better but
> it is preferable to have consistent style over the kernel.

I lean more towards "is it valid C or not"?

---
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
-
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