Skip to content

Clang does not define __STRICT_ANSI__ on Windows #147387

Open
@LIJI32

Description

@LIJI32

Clang's documents explicitly specify that cXX modes, in contrast to gnuXX modes, define __STRICT_ANSI__. However, it does not seem to be the case on Windows.

Tested:

clang version 20.1.7
Target: x86_64-pc-windows-msvc
Thread model: posix

On macOS, running clang -std=c11 -Xclang -dM -E - < /dev/null and clang -std=gnu11 -Xclang -dM -E - < /dev/null produce a single line of difference – #define __STRICT_ANSI__ 1. On Windows, however, both have identical outputs; __STRICT_ANSI__ is never defined.

This makes it hard to detect the availability on GNU extensions in headers.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions