Re: Sparse crash when mixing int and enum in ternary operator

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

 



Hi Chris,

On Wed March 24 2010 11:07:04 Christopher Li wrote:
> That is just too much. Most of the warning is coming from enum or
> operation. e.g.
> .type = KW_SPECIFIER | KW_SHORT,
> lookup_keyword(token->ident, NS_KEYWORD | NS_TYPEDEF);
> 
> I think those source are fine. Force enum cast there make the source code

I completely agree on that.

> lworse. We can add special case for enum OR enum, more special cases.
> But where is the end?

Let's handle the bitwise operators and we'll see.

> It comes down to we try to treat enum as a different type than int. It

>From my point of view it _is_ different type than int.  At least gcc 
distinguishes among enum and int on the level I grab the type-info.

> seems works for the simple case. But in real world, people do use enum as
> int type and expect enum can mix with int.

What about just changing the default?  We can keep the current -Wenum-mismatch 
(in its working variant) and those two new warnings provide only as option.

> At this point I am leaning towards moving this enum warning to a topic
> branch. Let the people who want to use it play with it first. It currently
> give too many warning.

Sure.

> If people do feel that warning is useful, even bette, it catch some real
> bugs. I will consider merge it again.

Yes, it makes sense to me.

> You obvious spend a lot of time on this. I feel bad about pushing it back
> too.

Spent time should be definitely not considered as a criterion
for inclusion ;-)

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