All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Nathan Chancellor' <natechancellor@gmail.com>,
	Masahiro Yamada <masahiroy@kernel.org>
Cc: Michal Marek <michal.lkml@markovi.net>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	clang-built-linux <clang-built-linux@googlegroups.com>,
	stable <stable@vger.kernel.org>
Subject: RE: [PATCH] kbuild: Disable -Wpointer-to-enum-cast
Date: Tue, 10 Mar 2020 11:31:01 +0000	[thread overview]
Message-ID: <c2a687d065c1463d8eea9947687b3b05@AcuMS.aculab.com> (raw)
In-Reply-To: <20200310012545.GA16822@ubuntu-m2-xlarge-x86>

From: Nathan Chancellor
> Sent: 10 March 2020 01:26
...
> Sure, I can send v2 to do that but I think that sending 97 patches just
> casting the small values (usually less than twenty) to unsigned long
> then to the enum is rather frivolous. I audited at least ten to fifteen
> of these call sites when creating the clang patch and they are all
> basically false positives.

Such casts just make the code hard to read.
If misused casts can hide horrid bugs.
IMHO sprinkling the code with casts just to remove
compiler warnings will bite back one day.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


  reply	other threads:[~2020-03-10 11:31 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-08  7:34 [PATCH] kbuild: Disable -Wpointer-to-enum-cast Nathan Chancellor
2020-03-09  2:11 ` Masahiro Yamada
2020-03-10  1:25   ` Nathan Chancellor
2020-03-10 11:31     ` David Laight [this message]
2020-03-10 15:30       ` Masahiro Yamada
2020-03-10 16:16         ` Nick Desaulniers
2020-03-10 18:20           ` Saravana Kannan
2020-03-10 16:48         ` Joe Perches
2020-03-09 12:25 ` Sasha Levin
2020-03-09 12:25   ` Sasha Levin
2020-03-10  1:14   ` Nathan Chancellor
2020-03-11 19:41 ` [PATCH v2] " Nathan Chancellor
2020-03-14  1:32   ` Masahiro Yamada

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=c2a687d065c1463d8eea9947687b3b05@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=natechancellor@gmail.com \
    --cc=stable@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 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.