All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: Pavel Roskin <proski@gnu.org>
Cc: Josh Triplett <josh@joshtriplett.org>,
	Christopher Li <sparse@chrisli.org>,
	linux-sparse@vger.kernel.org
Subject: Re: Sparse crash when mixing int and enum in ternary operator
Date: Wed, 10 Mar 2010 21:44:14 +0100	[thread overview]
Message-ID: <201003102144.14378.kdudka@redhat.com> (raw)
In-Reply-To: <1268252841.20800.42.camel@mj>

On Wednesday 10 of March 2010 21:27:21 Pavel Roskin wrote:
> That makes sense for certain kinds of software, where crash is too
> costly, but in case of sparse, I'd rather see it crash than ignore a
> condition that may indicate an error elsewhere (perhaps both in sparse
> and in the code it checks).
>
> I thing using assert() would be a better approach.  It's already used in
> sparse.
>
> I checked the whole kernel using assert in place of the NULL checks, and
> there have been no crashes.

I completely agree with that.  Let's give some time to sparse developers to 
respond.  If nobody objects, I'll change it to asserts.

> Maybe you could add a test case for the first patch?  What warnings does
> it remove?  What is "="?  Is it assignment or initialization or both?

Both of them.  Maybe worth to add a test-case for the initialization to make 
it more obvious...

> How about comparisons?

Definitely not.  That was the main goal of the 0001-Wenum-to-int patch.  It 
was really noisy since enum values are first implicitly casted to ints and 
then compared.  So there was no way to type-safely compare two enums without 
producing 6 lines of warnings.

> A better description would be nice.

Sure thing.  I didn't realize it was ambiguous.

Thank you for the review!

Kamil

  reply	other threads:[~2010-03-10 20:45 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 [this message]
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
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=201003102144.14378.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.