Skip to content

Commit ddc2a5f

Browse files
authored
[18.x][Docs] Add release note about Clang-defined target OS macros (#80044)
The change is included in the 18.x release. Move the release note to the release branch and reformat. (cherry picked from commit b40d5b1)
1 parent 0a44c37 commit ddc2a5f

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 25 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
@@ -351,6 +367,15 @@ New Compiler Flags
351367
* Full register names can be used when printing assembly via ``-mregnames``.
352368
This option now matches the one used by GCC.
353369

370+
.. _target_os_detail:
371+
372+
* ``-fdefine-target-os-macros`` and its complement
373+
``-fno-define-target-os-macros``. Enables or disables the Clang extension to
374+
provide built-in definitions of a list of ``TARGET_OS_*`` macros based on the
375+
target triple.
376+
377+
The extension is enabled by default for Darwin (Apple platform) targets.
378+
354379
Deprecated Compiler Flags
355380
-------------------------
356381

0 commit comments

Comments
 (0)