From: David Laight <David.Laight@ACULAB.COM>
To: "'Paul Moore'" <paul@paul-moore.com>,
"Christian Göttsche" <cgoettsche@seltendoof.de>,
"Linus Torvalds" <torvalds@linux-foundation.org>
Cc: "Christian Göttsche" <cgzones@googlemail.com>,
"Stephen Smalley" <stephen.smalley.work@gmail.com>,
"Ondrej Mosnacek" <omosnace@redhat.com>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"selinux@vger.kernel.org" <selinux@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"llvm@lists.linux.dev" <llvm@lists.linux.dev>
Subject: RE: [PATCH] selinux: use native iterator types
Date: Sat, 14 Dec 2024 21:07:20 +0000 [thread overview]
Message-ID: <f7bfbf89d2ac4b929637bbb25f749c96@AcuMS.aculab.com> (raw)
In-Reply-To: <e43da8418fc54a5eba7cdbb594b24bb9@paul-moore.com>
From: Paul Moore
> Sent: 11 December 2024 18:54
>
> On Nov 25, 2024 =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgoettsche@seltendoof.de> wrote:
> >
> > Use types for iterators equal to the type of the to be compared values.
> >
> > Reported by clang:
> >
> > security/selinux/ss/sidtab.c:126:2: warning: comparison of integers of different signs: 'int'
> and 'unsigned long' [-Wsign-compare]
> > 126 | hash_for_each_rcu(sidtab->context_to_sid, i, entry, list) {
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > ./include/linux/hashtable.h:139:51: note: expanded from macro 'hash_for_each_rcu'
> > 139 | for ((bkt) = 0, obj = NULL; obj == NULL && (bkt) < HASH_SIZE(name);\
> > | ~~~ ^ ~~~~~~~~~~~~~~~
> >
> > security/selinux/selinuxfs.c:1520:23: warning: comparison of integers of different signs: 'int'
> and 'unsigned int' [-Wsign-compare]
> > 1520 | for (cpu = *idx; cpu < nr_cpu_ids; ++cpu) {
> > | ~~~ ^ ~~~~~~~~~~
> >
> > security/selinux/hooks.c:412:16: warning: comparison of integers of different signs: 'int' and
> 'unsigned long' [-Wsign-compare]
> > 412 | for (i = 0; i < ARRAY_SIZE(tokens); i++) {
> > | ~ ^ ~~~~~~~~~~~~~~~~~~
Isn't this an example of why -Wsign-compare is entirely stupid and isn't enabled
in the normal kernel build?
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
next prev parent reply other threads:[~2024-12-14 21:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-25 11:06 [PATCH] selinux: use native iterator types Christian Göttsche
2024-12-11 18:54 ` Paul Moore
2024-12-14 21:07 ` David Laight [this message]
2024-12-14 21:10 ` Linus Torvalds
2024-12-14 22:48 ` Paul Moore
2024-12-16 14:18 ` Christian Göttsche
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=f7bfbf89d2ac4b929637bbb25f749c96@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=cgoettsche@seltendoof.de \
--cc=cgzones@googlemail.com \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
--cc=torvalds@linux-foundation.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