[clang] [clang][PP] Add extension to predefine target OS macros (PR #74676)

Florian Hahn via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 8 12:49:59 PST 2023


fhahn wrote:

It looks like this breaks building at least `MultiSource` from https://github.com/llvm/llvm-test-suite/. The first failure I see is when building `llvm-test-suite/MultiSource/Applications/ClamAV/zlib_zutil.c`

```
In file included from /llvm-test-suite/MultiSource/Applications/ClamAV/zlib_zutil.c:10:
In file included from test-suites/llvm-test-suite/MultiSource/Applications/ClamAV/zlib/gzguts.h:21:
../usr/include/stdio.h:220:7: error: expected identifier or '('
  220 | FILE    *fdopen(int, const char *) __DARWIN_ALIAS_STARTING(__MAC_10_6, __IPHONE_2_0, __DARWIN_ALIAS(fdopen));
      |          ^
llvm-test-suite/MultiSource/Applications/ClamAV/zlib/zutil.h:140:33: note: expanded from macro 'fdopen'
  140 | #        define fdopen(fd,mode) NULL /* No fdopen() */
      |                                 ^
llvm-project/builds/release-with-assertions/ccache-stage1/lib/clang/18/include/__stddef_null.h:26:16: note: expanded from macro 'NULL'
   26 | #define NULL ((void*)0)
      |                ^
```

I think it also breaks building PovRay from SPEC2017.

https://github.com/llvm/llvm-project/pull/74676


More information about the cfe-commits mailing list