Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3248035ybi; Mon, 29 Jul 2019 03:26:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqz8g390+38It19aXHu7L3pYO/H4y+yaNnB5kM9ugBHzaH0Aq6TkaXCnPk2uW+jIllYb7d+3 X-Received: by 2002:a17:902:20e9:: with SMTP id v38mr12424848plg.62.1564395991812; Mon, 29 Jul 2019 03:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564395991; cv=none; d=google.com; s=arc-20160816; b=Iv3uWVD9QFYRFTex4IVDyWYsbe1u7ZLHr0uXroGcAJch985HHu89FIFOc/9Fkb7vcS Mpjo19jqc1MwaKzn+yT4sLDqhJEFLy7oFl76UqnAGaFgR90OYj0h4ji5gwg23jxxDkVO 8tA8f/g3GG8BdrXBvTG+LUZx2mr0EQH+M2OR6u4lvKNdwzFwbHszk3CTN+ZsDMDh4nnO DUkcJvAUWkulU+bl4iWbWjpPoH5w+cEu+VNa2moEQLK0rkgCitwhzIEmUnQohy7XASou vjg/WwKnnxFnMYrSMs/9lf9j07rv6nJvk5ghPi3uT+JoCENdjTYkG3FHvXafLqfhMsWj Fphw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=3QG/kUhuAE8MMaoXvtWaTPQGQGI/Y1sg7QkkKpbh9L8=; b=JMdb0oF8h39dQ62T5MdC1tDCFe4yASQPv/RCOCa0l9NrnN2HKU3K2TO+Mjz14/qT7c NMPteU72YcNvpGbpQBw761iVXLxVo3ckH/XqGm01ysaUkZ1DWMJyuXbj9SmcUrY+jZHi t5prVUM/c2Ix+POgM4+EJvTM3+yOKqQ30yrckoLaJx9mz4KWIYOBrdaXEBNJYYLPGC7a fgHOu8Q+MxEreUWbcTIP5qnUrUdSkGIL0nbeDv4sKV0MYLFyiG2k3L2yHyJ5f7JcOyxE pMWOldDbKOIdSWWum9IJRyr2YLLzUNTooQAzxgQHfDR2Cn9AGn30wazvsD1fVuQO49yL r+HA== ARC-Authentication-Results: i=1; mx.google.com; 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 32si23308787plc.152.2019.07.29.03.26.16; Mon, 29 Jul 2019 03:26:31 -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; 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 S1728178AbfG2KYa convert rfc822-to-8bit (ORCPT + 99 others); Mon, 29 Jul 2019 06:24:30 -0400 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:49549 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728150AbfG2KYa (ORCPT ); Mon, 29 Jul 2019 06:24:30 -0400 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-234-VJwiHrKHPaOBTCMo7rm5ew-1; Mon, 29 Jul 2019 11:24:28 +0100 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b::d117) by AcuMS.aculab.com (fd9f:af1c:a25b::d117) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Mon, 29 Jul 2019 11:24:27 +0100 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Mon, 29 Jul 2019 11:24:27 +0100 From: David Laight To: "'Moore, Robert'" , Qian Cai , "Wysocki, Rafael J" CC: "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" Subject: RE: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings Thread-Topic: [PATCH v2] acpica: fix -Wnull-pointer-arithmetic warnings Thread-Index: AQHVPaHylXmfzBauvEybJLDaugeeCqbdV0WAgAQb46A= Date: Mon, 29 Jul 2019 10:24:27 +0000 Message-ID: References: <20190718194846.1880-1-cai@lca.pw> <94F2FBAB4432B54E8AACC7DFDE6C92E3B9661CBD@ORSMSX110.amr.corp.intel.com> In-Reply-To: <94F2FBAB4432B54E8AACC7DFDE6C92E3B9661CBD@ORSMSX110.amr.corp.intel.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: VJwiHrKHPaOBTCMo7rm5ew-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)