Skip to content

Commit 074aef5

Browse files
committed
[C99] Remove the tgmath.h header
Clang provides a number of headers which are required because the compiler is the only part of the implementation which can provide the correct macro definitions. Things like <limits.h> or <stdint.h> are such headers. <tgmath.h> is not something the compiler needs to provide macros for; it is the responsibility of the C Standard Library to provide these interfaces. Historically, Clang has provided tgmath.h from a time when C11 was still new and not all C Standard Libraries (such as the one from MSVC) had correct support. Today, that's no longer the case. So this change removes <tgmath.h> from the set of headers Clang provides and it is now on the user to provide a conforming C Standard Library if they would like to use this functionality.
1 parent cd56666 commit 074aef5

File tree

10 files changed

+3
-1436
lines changed

10 files changed

+3
-1436
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,9 @@ C Language Changes
122122
- Clang now allows an ``inline`` specifier on a typedef declaration of a
123123
function type in Microsoft compatibility mode. #GH124869
124124
- Clang now allows ``restrict`` qualifier for array types with pointer elements (#GH92847).
125+
- Clang no longer provides the ``tgmath.h`` header as part of the compiler-
126+
provided header files. This file needs to be provided by the C Standard
127+
Library being compiled against.
125128

126129
C2y Feature Support
127130
^^^^^^^^^^^^^^^^^^^

clang/lib/Headers/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ set(core_files
3333
__stddef_wint_t.h
3434
stdint.h
3535
stdnoreturn.h
36-
tgmath.h
3736
unwind.h
3837
varargs.h
3938
)

clang/lib/Headers/module.modulemap

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -305,11 +305,6 @@ module _Builtin_stdnoreturn [system] {
305305
export *
306306
}
307307

308-
module _Builtin_tgmath [system] {
309-
header "tgmath.h"
310-
export *
311-
}
312-
313308
module _Builtin_unwind [system] {
314309
header "unwind.h"
315310
export *

0 commit comments

Comments
 (0)