Issue 147387
Summary Clang does not define `__STRICT_ANSI__` on Windows
Labels clang
Assignees
Reporter LIJI32
    Clang's documents explicitly specify that [`cXX` modes, in contrast to `gnuXX` modes, define `__STRICT_ANSI__`](https://github.com/llvm/llvm-project/blob/122afae10ed28564b64530de571ce8e4ce584b2c/clang/docs/UsersManual.rst#differences-between-various-standard-modes). 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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to