linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: Christopher Li <sparse@chrisli.org>
Cc: Pavel Roskin <proski@gnu.org>,
	Josh Triplett <josh@joshtriplett.org>,
	linux-sparse@vger.kernel.org
Subject: Re: Sparse crash when mixing int and enum in ternary operator
Date: Wed, 24 Mar 2010 11:51:00 +0100	[thread overview]
Message-ID: <201003241151.00318.kdudka@redhat.com> (raw)
In-Reply-To: <70318cbf1003240307m6be38384l3524923484e493ce@mail.gmail.com>

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

  reply	other threads:[~2010-03-24 10:51 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-09  1:24 Sparse crash when mixing int and enum in ternary operator Pavel Roskin
2010-03-09  5:43 ` Christopher Li
2010-03-09 13:46   ` Kamil Dudka
2010-03-09 18:26     ` Pavel Roskin
2010-03-09 18:35     ` Pavel Roskin
2010-03-09 19:06       ` Kamil Dudka
2010-03-09 19:15         ` Josh Triplett
2010-03-09 20:11           ` Pavel Roskin
2010-03-09 20:29             ` Kamil Dudka
2010-03-09 23:30               ` Kamil Dudka
2010-03-10  1:09                 ` Pavel Roskin
2010-03-10 16:05                   ` Kamil Dudka
2010-03-10 20:27                     ` Pavel Roskin
2010-03-10 20:44                       ` Kamil Dudka
2010-03-10 21:03                       ` Kamil Dudka
2010-03-10 21:56                     ` Christopher Li
2010-03-13 17:22                       ` Kamil Dudka
2010-03-21 15:27                         ` Kamil Dudka
2010-03-24 10:07                           ` Christopher Li
2010-03-24 10:51                             ` Kamil Dudka [this message]
2010-03-27  9:16                             ` Kamil Dudka
2010-03-27  9:29                               ` Josh Triplett
2010-03-27  9:53                                 ` [PATCH] eliminate insane conversions from int to enum Kamil Dudka
2010-03-29 18:11                                   ` Christopher Li
2010-03-29 18:05                                 ` Sparse crash when mixing int and enum in ternary operator Christopher Li
2010-03-29 18:17                                   ` Kamil Dudka
2010-03-29 18:48                                     ` Christopher Li
2010-03-29 19:23                                       ` Kamil Dudka
2010-03-30  5:29                                         ` Pavel Roskin
2010-03-29 21:26                                   ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201003241151.00318.kdudka@redhat.com \
    --to=kdudka@redhat.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=proski@gnu.org \
    --cc=sparse@chrisli.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).