Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,6 @@ cmake/macro-conf/*.cmakedef

# AI tooling items to ignore:
CLAUDE.md

# macOS specific items to ignore:
*.DS_Store
2 changes: 0 additions & 2 deletions bases/cmake-native/macos-arm/clang/lib/predefined_macros.txt
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ clang no __ATOMIC_RELEASE 3
clang no __ATOMIC_SEQ_CST 5
clang no __BIGGEST_ALIGNMENT__ 8
clang no __BITINT_MAXWIDTH__ 128
clang no __BLOCKS__ 1
clang no __BOOL_WIDTH__ 8
clang no __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
clang no __CHAR_BIT__ 8
Expand Down Expand Up @@ -439,7 +438,6 @@ clang no __aarch64__ 1
clang no __apple_build_version__ 15000309
clang no __arm64 1
clang no __arm64__ 1
clang no __block __attribute__((__blocks__(byref)))
clang no __clang_literal_encoding__ "UTF-8"
clang no __clang_wide_literal_encoding__ "UTF-32"
clang no __llvm__ 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ clang no __ATOMIC_RELEASE 3
clang no __ATOMIC_SEQ_CST 5
clang no __BIGGEST_ALIGNMENT__ 8
clang no __BITINT_MAXWIDTH__ 128
clang no __BLOCKS__ 1
clang no __BOOL_WIDTH__ 8
clang no __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
clang no __CHAR_BIT__ 8
Expand Down Expand Up @@ -439,7 +438,6 @@ clang no __aarch64__ 1
clang no __apple_build_version__ 15000309
clang no __arm64 1
clang no __arm64__ 1
clang no __block __attribute__((__blocks__(byref)))
clang no __clang_literal_encoding__ "UTF-8"
clang no __clang_wide_literal_encoding__ "UTF-32"
clang no __llvm__ 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ clang no __ATOMIC_RELAXED 0
clang no __ATOMIC_RELEASE 3
clang no __ATOMIC_SEQ_CST 5
clang no __BIGGEST_ALIGNMENT__ 16
clang no __BLOCKS__ 1
clang no __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
clang no __CHAR_BIT__ 8
clang no __CLANG_ATOMIC_BOOL_LOCK_FREE 2
Expand Down Expand Up @@ -387,7 +386,6 @@ clang no __WINT_WIDTH__ 32
clang no __amd64 1
clang no __amd64__ 1
clang no __apple_build_version__ 12050022
clang no __block __attribute__((__blocks__(byref)))
clang no __code_model_small__ 1
clang no __core2 1
clang no __core2__ 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ clang no __ATOMIC_RELAXED 0
clang no __ATOMIC_RELEASE 3
clang no __ATOMIC_SEQ_CST 5
clang no __BIGGEST_ALIGNMENT__ 16
clang no __BLOCKS__ 1
clang no __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
clang no __CHAR_BIT__ 8
clang no __CLANG_ATOMIC_BOOL_LOCK_FREE 2
Expand Down Expand Up @@ -387,7 +386,6 @@ clang no __WINT_WIDTH__ 32
clang no __amd64 1
clang no __amd64__ 1
clang no __apple_build_version__ 12050022
clang no __block __attribute__((__blocks__(byref)))
clang no __code_model_small__ 1
clang no __core2 1
clang no __core2__ 1
Expand Down
1 change: 1 addition & 0 deletions tests/tests/changes/.GH307.rto/default.1.1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fe_only -DTEST_NUMBER=1 --clang Test_name.c
28 changes: 28 additions & 0 deletions tests/tests/changes/GH307.sft.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//type:fp
//options:--clang
//remark:[GH #307] The macOS clang bases no longer predefine __BLOCKS__ and __block
//
// The front end does not support Apple's blocks extension (there is no block
// pointer type, and "^" cannot start a declarator), so __BLOCKS__ must not be
// predefined: the macOS SDK headers declare their block-taking functions
// (atexit_b, bsearch_b, qsort_b, ...) under "#ifdef __BLOCKS__", and every
// translation unit that included <stdlib.h> got errors.

// The declaration that failed to parse.
#if __BLOCKS__
int atexit_b(void (^)(void));
#endif

#ifdef __BLOCKS__
#error "__BLOCKS__ is defined"
#endif

#ifdef __block
#error "__block is defined"
#endif

#if __has_feature(blocks) || __has_extension(blocks)
#error "the front end does not support blocks"
#endif

int main() { return 0; }
16 changes: 16 additions & 0 deletions util/Changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
Version 7.1

10/15/26 [GH #307]
Suppress the blocks macros in make_predef_macro_table output

The __BLOCKS__ and __block macros are now suppressed when running
make_predef_macro_table with --clang (so these don't end up in a
predefined_macros.txt file). Clang defines them together when the blocks
extension is enabled (the default for Apple clang), but the front end does not
support that extension, and the system headers that test __BLOCKS__ (the macOS
SDK declares atexit_b, qsort_b and others under it) would then use block
pointer types. They have also been removed from the predefined_macros.txt
files of the macOS clang bases.


-------------------------------------------------------------------------------
Version 7.0, September 28, 2026

9/27/26 [EDGcpfe/29061]
Expand Down
2 changes: 2 additions & 0 deletions util/make_predef_macro_table
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ delete_unneeded_entries()
unneeded="$unneeded __clang_minor__"
unneeded="$unneeded __clang_patchlevel__"
unneeded="$unneeded __clang_version__"
unneeded="$unneeded __BLOCKS__"
unneeded="$unneeded __block"
else
unneeded="$unneeded __GNUC__"
unneeded="$unneeded __GNUC_MINOR__"
Expand Down
Loading