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

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

 



On Fri, 2007-02-02 at 13:56 -0800, Christopher Li wrote:

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

You need -Wundef or -Wall to check for undefined preprocessor symbols.

$ sparse -Wundef test.c 
test.c:1:5: warning: undefined preprocessor identifier
'SYMBOL_NOT_DEFINED'
test.c:4:2: warning: "not defined"

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