Skip to content

Commit f0f63d3

Browse files
committed
[Docs] Add release note about Clang-defined target OS macros (#79879)
(cherry picked from commit b40d5b1)
1 parent bab01ae commit f0f63d3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,22 @@ AST Dumping Potentially Breaking Changes
171171
"qualType": "foo"
172172
}
173173
174+
Clang Frontend Potentially Breaking Changes
175+
-------------------------------------------
176+
- Target OS macros extension
177+
A new Clang extension (see :ref:`here <target_os_detail>`) is enabled for
178+
Darwin (Apple platform) targets. Clang now defines ``TARGET_OS_*`` macros for
179+
these targets, which could break existing code bases with improper checks for
180+
the ``TARGET_OS_`` macros. For example, existing checks might fail to include
181+
the ``TargetConditionals.h`` header from Apple SDKs and therefore leaving the
182+
macros undefined and guarded code unexercised.
183+
184+
Affected code should be checked to see if it's still intended for the specific
185+
target and fixed accordingly.
186+
187+
The extension can be turned off by the option ``-fno-define-target-os-macros``
188+
as a workaround.
189+
174190
What's New in Clang |release|?
175191
==============================
176192
Some of the major new features and improvements to Clang are listed
@@ -344,6 +360,14 @@ New Compiler Flags
344360
(like other functions) with respect to visibility attributes, pragmas and
345361
options (e.g ``--fvisibility=``).
346362

363+
.. _target_os_detail:
364+
* ``-fdefine-target-os-macros`` and its complement
365+
``-fno-define-target-os-macros``. Enables or disables the Clang extension to
366+
provide built-in definitions of a list of ``TARGET_OS_*`` macros based on the
367+
target triple.
368+
369+
The extension is enabled by default for Darwin (Apple platform) targets.
370+
347371
Deprecated Compiler Flags
348372
-------------------------
349373

0 commit comments

Comments
 (0)