From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 257E7C04AB5 for ; Mon, 3 Jun 2019 10:57:06 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF053280DE for ; Mon, 3 Jun 2019 10:57:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF053280DE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:33098 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXkeH-00079F-7L for qemu-devel@archiver.kernel.org; Mon, 03 Jun 2019 06:57:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:44789) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXkdS-0006dp-6U for qemu-devel@nongnu.org; Mon, 03 Jun 2019 06:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXkdP-00063c-KD for qemu-devel@nongnu.org; Mon, 03 Jun 2019 06:56:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44320) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hXkdL-0005my-EV for qemu-devel@nongnu.org; Mon, 03 Jun 2019 06:56:08 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 75A2FC024920; Mon, 3 Jun 2019 10:55:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-121-13.rdu2.redhat.com [10.10.121.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id 03E281001E6E; Mon, 3 Jun 2019 10:55:02 +0000 (UTC) To: Markus Armbruster , qemu-devel@nongnu.org References: <87lfyqla7r.fsf@dusky.pond.sub.org> From: Laszlo Ersek Message-ID: <4397594e-ccba-3f54-6359-2cb061b8fcc0@redhat.com> Date: Mon, 3 Jun 2019 12:55:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <87lfyqla7r.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Mon, 03 Jun 2019 10:56:01 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] Headers without multiple inclusion guards X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Chris Wulff , Sagar Karandikar , David Hildenbrand , James Hogan , Anthony Green , Palmer Dabbelt , Mark Cave-Ayland , Max Filippov , Dmitry Fleytman , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Guan Xuetao , Marek Vasut , Stefano Stabellini , Aleksandar Rikalo , Helge Deller , "Michael S. Tsirkin" , Halil Pasic , Christian Borntraeger , Anthony Perard , Richard Henderson , Jason Wang , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Riku Voipio , Eduardo Habkost , Alistair Francis , Greg Kurz , Marcelo Tosatti , Beniamino Galvani , Eric Auger , Paul Durrant , Stafford Horne , =?UTF-8?Q?Alex_Benn=c3=a9e?= , David Gibson , "Daniel P. Berrange" , Claudio Fontana , Bastian Koppelmann , Cornelia Huck , Claudio Fontana , Laurent Vivier , Andrew Baumann , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= , Michael Walle , Aleksandar Markovic , Paolo Bonzini , Aurelien Jarno , =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Hi Markus, (sorry about the late reply, I've been away.) On 05/28/19 20:12, Markus Armbruster wrote: > EDK2 Firmware > M: Laszlo Ersek > M: Philippe Mathieu-Daud=C3=A9 > tests/uefi-test-tools/UefiTestToolsPkg/Include/Guid/BiosTablesTest.h This header file does have a multiple inclusion guard: > /** @file > Expose the address(es) of the ACPI RSD PTR table(s) and the SMBIOS en= try > point(s) in a MB-aligned structure to the hypervisor. > > [...] > **/ > > #ifndef __BIOS_TABLES_TEST_H__ > #define __BIOS_TABLES_TEST_H__ > > [...] > > #endif // __BIOS_TABLES_TEST_H__ It's possible that "scripts/clean-header-guards.pl" does not recognize the guard. According to the ISO C standard, "All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use". Therefore, technically speaking, the above inclusion guard implies undefined behavior. In practice, this particular style for header guards is extremely common in the edk2 codebase: $ git grep '^#ifndef __' -- '*.h' | wc -l 1012 And, "tests/uefi-test-tools/UefiTestToolsPkg" follows the edk2 coding style. That said, if you'd like to remove the leading "__" from the macro name, I'd be fully OK with that. Thank you! Laszlo