From: Qian Cai <cai@lca.pw>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "Moore, Robert" <robert.moore@intel.com>,
"Wysocki, Rafael J" <rafael.j.wysocki@intel.com>,
"Schmauss, Erik" <erik.schmauss@intel.com>,
"jkim@FreeBSD.org" <jkim@FreeBSD.org>,
"lenb@kernel.org" <lenb@kernel.org>,
"ndesaulniers@google.com" <ndesaulniers@google.com>,
"linux-acpi@vger.kernel.org" <linux-acpi@vger.kernel.org>,
"devel@acpica.org" <devel@acpica.org>,
"clang-built-linux@googlegroups.com"
<clang-built-linux@googlegroups.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings
Date: Mon, 29 Jul 2019 08:23:57 -0400 [thread overview]
Message-ID: <7667BD59-E9FF-4374-AEF6-025FD13837B6@lca.pw> (raw)
In-Reply-To: <c98fa373a004472b979255a93b414fe1@AcuMS.aculab.com>
> On Jul 29, 2019, at 6:24 AM, David Laight <David.Laight@ACULAB.COM> wrote:
>
> From: Moore, Robert
>> Sent: 26 July 2019 20:36
> ...
>> This is because pointer arithmetic
>> on a pointer not pointing to an array is an undefined behavior (C11 6.5.6, constraint 8).
> ...
>
> The standards committee as smoking dope again :-)
> If that is enforced as a compiler warning/error a lot of code 'breaks'.
> Anything that does:
> struct foo *foo = ...;
> struct bar *bar = (void *)(foo + 1);
> suddenly becomes 'invalid’.
The clang will generate a warning only if “foo" is NULL.
next prev parent reply other threads:[~2019-07-29 12:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-18 19:48 [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings Qian Cai
2019-07-26 19:35 ` Moore, Robert
2019-07-29 10:24 ` David Laight
2019-07-29 12:23 ` Qian Cai [this message]
2019-08-01 19:16 ` Qian Cai
2019-08-01 20:17 ` Schmauss, Erik
2019-08-01 20:28 ` Moore, Robert
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=7667BD59-E9FF-4374-AEF6-025FD13837B6@lca.pw \
--to=cai@lca.pw \
--cc=David.Laight@ACULAB.COM \
--cc=clang-built-linux@googlegroups.com \
--cc=devel@acpica.org \
--cc=erik.schmauss@intel.com \
--cc=jkim@FreeBSD.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ndesaulniers@google.com \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@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;
as well as URLs for NNTP newsgroup(s).