public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: kernel test robot <lkp@intel.com>
Cc: Dan Carpenter <error27@gmail.com>,
	kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: Re: [linux-stable-rc:linux-4.4.y 1449/1774] drivers/input/joydev.c:485:16: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int'
Date: Mon, 19 Jul 2021 10:17:58 +0300	[thread overview]
Message-ID: <20210719071758.GP1931@kadam> (raw)
In-Reply-To: <202107191112.AwqoFW63-lkp@intel.com>

On Mon, Jul 19, 2021 at 11:39:16AM +0800, kernel test robot wrote:
>    drivers/input/joydev.c: In function 'joydev_handle_JSIOCSAXMAP':
>    drivers/input/joydev.c:451:16: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
>      451 |  for (i = 0; i < len && i < joydev->nabs; i++) {

We should figure out a way to turn this warning off in the compiler.

It's a stupid warning.  It never fixes any bugs.  It sometimes
introduces bugs.

In the kernel if you are in drivers/ and you have a loop which iterates
over 2 million times that's probably a bug.  But GCC is very very
stupid and not designed to be a static analysis tool.  It does not know
which loops can iterate more than 2 million times.  Even when it knows
that the loop only loops up to 5 or 10 times it still warns that maybe
it will loop over 2 million times.  INSULTS AND DISPARAGEMENT!

Seriously, please disable this warning unless you can point to one
single bug that it has fixed.

regards,
dan carpenter


  reply	other threads:[~2021-07-19  7:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-19  3:39 [linux-stable-rc:linux-4.4.y 1449/1774] drivers/input/joydev.c:485:16: warning: comparison of integer expressions of different signedness: 'int' and 'long unsigned int' kernel test robot
2021-07-19  7:17 ` Dan Carpenter [this message]
2021-07-19  8:46   ` [kbuild-all] " Rong Chen

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=20210719071758.GP1931@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    /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