Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3583426ybi; Mon, 29 Jul 2019 09:02:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFOnwUOovxCoYFlLd0ZDLKMK7KjfQAmnY8v/kHnAyhfDwHegGOkXF5O4t/ul/TrsihyZsa X-Received: by 2002:aa7:9819:: with SMTP id e25mr36285181pfl.47.1564416123245; Mon, 29 Jul 2019 09:02:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564416123; cv=none; d=google.com; s=arc-20160816; b=jrUnBPfEqvPPCgTlVdGOa+xsD0oajcb3CmJjFmCpL17cyUac3gaBglVgwha/A8L0yo uf66kmztTEmiJ9bv7ysyB/titwmxeOrNngP9k2ND6IpeawwerRt9EPrSm6tF7p+m7k7i z5fRXHpwflVBZeZ4swfBjaY6SzBXa/PDUCkkR7OwAQmM+00f4m/IjgD04o6slGM2Vfxt vwSWjv3fmhAB7pNc16BxXvyetEB0PEME9ptYhLaem+ULF7rZ8ycOyGQ/q5d36a4HQFE1 2yTAo63aueqx+cl0LRbrLUmVRPNgClnTnWYjLaGvSvRCpAKGeEFk2ud3wY3aMgkpU5sF MWWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=h93KMWTgMZDnkWWP8nidzTcTTS/K0DE/79C+3LGxZF0=; b=ryqahxXibeAIQTQBpaEQnKWzEf0ihdO2N1ZRuePxPSQ+NWnAbvsGznFpKVXCQbcPvQ FdfhQyDO5TkQ+X4zdR+Gdrq5w5XMW9LLFZCgmoI5Pq9i9Aj5LUNmg1p3qAb2QLLJZe/l VIHwn+EfoUoZ1eDY/HpIBsxJNeVjkt3gR1uQ9eewvoabyGNm9lrqtZMTpfytKQdb4Ie9 LDMS2MbZFOm3CVJCC7E3zTGUVeNCjWVzne1bTh7GAxsbvFM6rHrSNXkMVtHj4MPWqe5l xPXBRkc0DLsYJdjshrhLOGBWhmh++OARrhnG9WxB1BPGAPVtHZJ3NKUDPzp2Hry71jKQ aWaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Hc9DVUB9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id go9si23799153plb.268.2019.07.29.09.01.45; Mon, 29 Jul 2019 09:02:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Hc9DVUB9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727952AbfG2MYA (ORCPT + 99 others); Mon, 29 Jul 2019 08:24:00 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:36993 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726255AbfG2MX7 (ORCPT ); Mon, 29 Jul 2019 08:23:59 -0400 Received: by mail-qk1-f195.google.com with SMTP id d15so43910122qkl.4 for ; Mon, 29 Jul 2019 05:23:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=h93KMWTgMZDnkWWP8nidzTcTTS/K0DE/79C+3LGxZF0=; b=Hc9DVUB9zGGrVJ8J2XEA+M4C3aZJx9c49dmpHKzoNCU2ejgaEqSxcv3fhGVhL+uzWw nHL4gBKdAutOpH1vaKc1M6+W0ck2WmO/L3JPOdrvghzNnafLHj6ur1wKr7AhxxFvvPuO 6KxorB8bmMspaipmAq0EUj8Du3vfHbwgnUGzgFQHhAd3dK0QvoB12hNRn/RBdV0hltUZ 3WuVf+t2D413Q+eztp06HMs3MEBWx3stoWCezwzdZJWPXNxgeD+Mkpgk2XvXR1mxBzzS +m4M/kIRbiIDW/AKv6ZwMZxdHrWUx0B4rAj66mKfJRrJ1kwrOvJ+8dWdCUCWjDy9t6bG SVHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=h93KMWTgMZDnkWWP8nidzTcTTS/K0DE/79C+3LGxZF0=; b=QNcsFU3i/i7VaayrMmn/tfKKgqENWAXfn8JQJR0DGJXZPtYkGv5nMpAkZwbDEJAsIn D6/P6nJpomgg874pikbR6f3wtBFugF+QJgYmLpuQqR0Q4d6i4AFQigqaG2sdp8hZEik/ +06FSsTngZWLR12I3eODaOUZnhLg6bd8+Sz/yjSraCPYnfMM+D6j+Cq0INNgPXLcSLKk Uxq/VmgCJl0W6dYQMkSelhEJmBXcCbjkoHIVgwaYU01WaqNPcaJEJIPDQnGaB2lqytKd wT/Szsd7QI7u/1NbHd4em/yz447ykpJAvgtPuNdvbhR3CxTqMecDkdXwj/+sh01usq5t HYow== X-Gm-Message-State: APjAAAUgexh23xF5dziasSUcPwqJkhH/E4nMc3gS2zYHtUgqe8tXyllq /1Q7gMrJFePogwK6S7EVZ7N4Ww== X-Received: by 2002:a37:4a8a:: with SMTP id x132mr74044881qka.42.1564403038878; Mon, 29 Jul 2019 05:23:58 -0700 (PDT) Received: from [192.168.1.153] (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id 2sm32890868qtz.73.2019.07.29.05.23.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jul 2019 05:23:58 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings From: Qian Cai In-Reply-To: Date: Mon, 29 Jul 2019 08:23:57 -0400 Cc: "Moore, Robert" , "Wysocki, Rafael J" , "Schmauss, Erik" , "jkim@FreeBSD.org" , "lenb@kernel.org" , "ndesaulniers@google.com" , "linux-acpi@vger.kernel.org" , "devel@acpica.org" , "clang-built-linux@googlegroups.com" , "linux-kernel@vger.kernel.org" Content-Transfer-Encoding: quoted-printable Message-Id: <7667BD59-E9FF-4374-AEF6-025FD13837B6@lca.pw> References: <20190718194846.1880-1-cai@lca.pw> <94F2FBAB4432B54E8AACC7DFDE6C92E3B9661CBD@ORSMSX110.amr.corp.intel.com> To: David Laight X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Jul 29, 2019, at 6:24 AM, David Laight = wrote: >=20 > 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). > ... >=20 > 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 =3D ...; > struct bar *bar =3D (void *)(foo + 1); > suddenly becomes 'invalid=E2=80=99. The clang will generate a warning only if =E2=80=9Cfoo" is NULL.