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 <ler...@redhat.com>
> M: Philippe Mathieu-Daudé <phi...@redhat.com>
> 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 entry
>   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

Reply via email to