Skip to content

Including <isa_availability.h> emits a non-reserved name #3692

@StephanTLavavej

Description

@StephanTLavavej

The STL's headers (currently <bit>, <complex>, <limits>) include <isa_availability.h>:

#include <isa_availability.h>

STL/stl/inc/bit

Lines 195 to 197 in 5404ba9

extern "C" {
extern int __isa_available;
}

STL/stl/inc/bit

Line 256 in 5404ba9

const bool _Definitely_have_lzcnt = __isa_available >= __ISA_AVAILABLE_AVX2;

This VCRuntime header emits a non-reserved name, enum ISA_AVAILABILITY. Even though we don't use it directly, this could be seen as an extremely minor conformance issue.

While we strictly avoid enormously polluting headers like <Windows.h>, we have to include many intrinsics and UCRT headers which emit lots of MS-specific non-reserved names. This seems minor enough that I am strongly tempted to resolve it as wontfix. However, the fact that we have to manually declare extern "C" { extern int __isa_available; } every time (which is not provided by <isa_availability.h>) is a minor annoyance. If we wanted to do something about this, we could consider creating our own helper header, with an independent declaration of this variable and the constants we need, which would also avoid emitting the non-reserved name. (It would then be a good idea to static_assert in a source file that our own constants are identical to the official constants.)

Originally reported as DevCom-10357533 and internal VSO-1817556 / AB#1817556 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions