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

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

 



On Fri, Feb 02, 2007 at 10:25:12AM -0800, Linus Torvalds wrote:
> 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.
> 
I did some trivial test:

#if SYMBOL_NOT_DEFINED
#warning "defined"
#else
#warning "not defined"
#endif

On sparse git tip, or sparse 0.2. Here is what I get:

./sparse /tmp/a.c 
/tmp/a.c:5:2: warning: "not defined"

That is what Pavel wants. So Linus should complain instead.

I am confused.

Chris

-
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