Skip to content

Commit

Permalink
importc.h: Don't undefine __has_(feature|extension) on >=gcc-14
Browse files Browse the repository at this point in the history
GCC 14 started emitting a warning about those two `#undef`s. This
breaks basically all C tests as it interferes with the output.

Signed-off-by: Andrei Horodniceanu <[email protected]>
  • Loading branch information
the-horo committed Jun 5, 2024
1 parent 05c8980 commit f560757
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions druntime/src/importc.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,17 @@ typedef unsigned long long __uint64_t;
* __has_extension is a clang thing:
* https://clang.llvm.org/docs/LanguageExtensions.html
* ImportC no has extensions.
*
* >=gcc-14 prints a warning for each #undef. This breaks a lot of
* things like the testsuite which expects clean output.
*/
#if __GNUC__ < 14
#undef __has_feature
#define __has_feature(x) 0

#undef __has_extension
#define __has_extension(x) 0
#endif

/*************************************
* OS-specific macros
Expand Down

0 comments on commit f560757

Please sign in to comment.