mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i386, nmi: signed vs unsigned mixup
Date: Mon, 21 Nov 2005 11:40:38 +0100	[thread overview]
Message-ID: <9a8748490511210240n97ab19ev8c27dc7b6f0e3d51@mail.gmail.com> (raw)
In-Reply-To: <9a8748490511191745h6aebd102r91007bc2b84382ff@mail.gmail.com>

On 11/20/05, Jesper Juhl <jesper.juhl@gmail.com> wrote:
> On 11/20/05, Andrew Morton <akpm@osdl.org> wrote:
[snip]
> >
> > Sure, go for it - let's see what the patches end up looking like.  We might
> > find real bugs in there - I found a bunch of howlers back in 2.3.late.
> > That was with `gcc -W' which turns on more than -Wsigned-compare.
> >
> > Maybe you could prepare a quick overall summary first, see if you can work
> > out the overall scope of the problem and then we can take a look at that,
> > decide what bits to attack?
> >
> Sure, I'll do that tomorrow.
> All these sign issues all over annoy me :)
> I'll try to get a handle on the scope of the thing tomorrow, then send
> a mail with what I find, then we can talk about what would be useful
> to do.
>

Ok, I did an allyesconfig build (x86 build) of 2.6.15-rc2 with
-Wsign-compare and I have some numbers.

The total number of warnings for the build ended up at 14681
Of course some of the warnings are not related to sign issues, so
let's look at just

comparison between signed and unsigned   (12378 instances of this one)
signed and unsigned type in conditional expression   (2109 instances
of this one)
comparison of promoted ~unsigned with constant   (4 instances of this one)

So for the signedness related warnings we have a total of 14491 warnings.
The 14491 warnings come from a total of 1701 files.

This looks like a lot, but it's really not as bad as it looks since a
lot of the warnings are duplicates.

Let's take a look at the top 10 offenders :

1)
4078 counts of
warning: comparison between signed and unsigned
from include/asm/bitops.h:339

2)
1125 counts of
warning: comparison between signed and unsigned
from include/linux/netdevice.h:796

3)
256 counts of
warning: signed and unsigned type in conditional expression
from drivers/scsi/aic7xxx/aic79xx_osm_pci.c:79

4)
256 counts of
warning: signed and unsigned type in conditional expression
from drivers/scsi/aic7xxx/aic79xx_osm_pci.c:77

5)
120 counts of
warning: signed and unsigned type in conditional expression
from fs/xfs/xfs_mount.h:458

6)
90 counts of
warning: comparison between signed and unsigned
from include/net/tcp_ecn.h:53

7)
90 counts of
warning: comparison between signed and unsigned
from include/net/tcp.h:866

8)
90 counts of
warning: signed and unsigned type in conditional expression
from include/net/tcp.h:1148

9)
90 counts of
warning: signed and unsigned type in conditional expression
from include/net/tcp.h:1143

10)
86 counts of
warning: comparison between signed and unsigned
from include/linux/fb.h:859


So, if we just cleaned up the top 10 offenders we'd get rid of 6281
out of the total 14491 warnings.

I've not yet looked at what would be involved in fixing these top 10,
I'll look at that later, for now I just wanted to post the numbers I
had.


--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

  reply	other threads:[~2005-11-21 10:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-19 23:10 Jesper Juhl
2005-11-20  0:28 ` Andrew Morton
2005-11-20  0:30   ` Jesper Juhl
2005-11-20  1:08     ` Andrew Morton
2005-11-20  1:15       ` Jesper Juhl
2005-11-20  1:33         ` Andrew Morton
2005-11-20  1:45           ` Jesper Juhl
2005-11-21 10:40             ` Jesper Juhl [this message]
2005-11-21 20:20               ` Andrew Morton

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=9a8748490511210240n97ab19ev8c27dc7b6f0e3d51@mail.gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®