https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78352
Bug ID: 78352 Summary: GCC lacks support for the Apple "blocks" extension to the C family of languages Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: egall at gwmail dot gwu.edu Target Milestone: --- In bug 78267 Iain suggested to open a separate bug for the issue of missing Apple-blocks support in FSF GCC, so that's what this bug is. Here is an example of code that is currently rejected due to lack of support for this feature: typedef void (^os_trace_payload_t)(xpc_object_t xdict); In Apple's gcc and clang, support for blocks can be enabled with the -fblocks flag, and can be detected by the presence of the __BLOCKS__ preprocessor macro. This extension applies to all members of the C family: C, C++, Objective C, and Objective C++. Further information: https://gcc.gnu.org/ml/gcc/2009-09/msg00277.html (and the rest of the thread) https://gcc.gnu.org/ml/gcc/2013-11/msg00039.html (likewise, & rest of thread) Bug 63651 http://clang.llvm.org/docs/BlockLanguageSpec.html http://clang.llvm.org/docs/Block-ABI-Apple.html http://www.open-std.org/JTC1/sc22/wg14/www/docs/n1370.pdf https://en.wikipedia.org/wiki/Blocks_%28C_language_extension%29