From: David Laight <David.Laight@ACULAB.COM>
To: "'Chen, Rong A'" <rong.a.chen@intel.com>,
Ilya Dryomov <idryomov@gmail.com>,
kernel test robot <lkp@intel.com>
Cc: "kbuild-all@lists.01.org" <kbuild-all@lists.01.org>,
"clang-built-linux@googlegroups.com"
<clang-built-linux@googlegroups.com>,
LKML <linux-kernel@vger.kernel.org>
Subject: RE: [kbuild-all] Re: net/ceph/messenger_v2.c:2808:5: warning: stack frame size (2336) exceeds limit (2048) in function 'ceph_con_v2_try_read'
Date: Mon, 28 Jun 2021 08:24:15 +0000 [thread overview]
Message-ID: <3d6a513b51d545cc87a7a0ae22452567@AcuMS.aculab.com> (raw)
In-Reply-To: <a875976b-3117-f001-606b-8e90802bef8a@intel.com>
...
> >> arch/powerpc/include/asm/io-defs.h:43:1: warning: performing pointer arithmetic on a null
> pointer has undefined behavior [-Wnull-pointer-arithmetic]
I've just realised why that error is output.
The result of (long)((char *)0 + 4) is only 4 if the NULL pointer
has the 'all-zero' bit pattern.
This isn't mandated by the language.
However I suspect almost every implementation of C there has ever
been has used the all-zero bit pattern for NULL.
This includes one system I used (many years ago) where the 'natural'
NULL pointer would have been the all-ones pattern.
Far too much code assumes memset(ptr, 0, len) will set pointers
to NULL for any other value to ever work.
Of course 'undefined behaviour' doesn't mean 'undefined value'
it includes firing a ICBM at the coder's house.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
prev parent reply other threads:[~2021-06-28 8:24 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-28 1:24 kernel test robot
2021-06-28 8:02 ` Ilya Dryomov
2021-06-28 8:05 ` [kbuild-all] " Chen, Rong A
2021-06-28 8:24 ` David Laight [this message]
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=3d6a513b51d545cc87a7a0ae22452567@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=clang-built-linux@googlegroups.com \
--cc=idryomov@gmail.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=rong.a.chen@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
all inboxes | Powered by JetHome®