Re: Feature request - allow boolean operations of undefined cpp symbols

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

 




On Fri, 2 Feb 2007, Pavel Roskin wrote:
> 
> I think sparse should distinguish between safe and unsafe preprocessor
> operations on undefined symbols.

It does.

Try this:

	#define NECESSARY 1

	#if NECESSARY || UNNECESSARY
	#endif

and notice how sparse does NOT warn about UNNECESSARY not being defined. 
Because it doesn't matter.

> For instance, "#if SYMBOL" has a very specific meaning

No.

	#if SYMBOL

has a very specific *problem* - it very possibly is a typo.

So this is a warning I absolutely *want* for the kernel. If some other 
projects don't want it, fine, but it should be on by default as a warnign 
for potentially dangerous use of preprocessor symbols.

		Linus
-
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