[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c98fa373a004472b979255a93b414fe1@AcuMS.aculab.com>
Date: Mon, 29 Jul 2019 10:24:27 +0000
From: David Laight <David.Laight@...LAB.COM>
To: "'Moore, Robert'" <robert.moore@...el.com>, Qian Cai <cai@....pw>,
"Wysocki, Rafael J" <rafael.j.wysocki@...el.com>
CC: "Schmauss, Erik" <erik.schmauss@...el.com>,
"jkim@...eBSD.org" <jkim@...eBSD.org>,
"lenb@...nel.org" <lenb@...nel.org>,
"ndesaulniers@...gle.com" <ndesaulniers@...gle.com>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"devel@...ica.org" <devel@...ica.org>,
"clang-built-linux@...glegroups.com"
<clang-built-linux@...glegroups.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings
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'.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists