[PATCH] D117935: [AIX][clang] include_next through clang provided float.h
Hubert Tong via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 21 19:34:11 PST 2022
hubert.reinterpretcast added inline comments.
================
Comment at: clang/lib/Headers/float.h:40-41
# undef LDBL_MANT_DIG
-# if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || \
+ __cplusplus >= 201103L || defined(_AIX) && defined(_ALL_SOURCE)
# undef DECIMAL_DIG
----------------
Do not remove scoping indentation; see below where reformatting actively causes confusion.
================
Comment at: clang/lib/Headers/float.h:68-69
# undef LDBL_MIN
-# if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || \
+ __cplusplus >= 201703L || defined(_AIX) && defined(_ALL_SOURCE)
# undef FLT_TRUE_MIN
----------------
Change in indentation makes it look like (an casual reading) that the corresponding `#endif` is the one on line 80.
================
Comment at: clang/lib/Headers/float.h:92-93
-#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || __cplusplus >= 201103L
+#if __STDC_VERSION__ >= 199901L || !defined(__STRICT_ANSI__) || \
+ __cplusplus >= 201103L || defined(_AIX) && defined(_ALL_SOURCE)
# define DECIMAL_DIG __DECIMAL_DIG__
----------------
I understand why `_ALL_SOURCE` matters when `__STDC_HOSTED__` does not evaluate to 0, but the general logic of the file is that platform extensions are not present for freestanding. The interfaces injected via `_ALL_SOURCE` are platform extensions.
================
Comment at: clang/lib/Headers/float.h:129-130
-#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || __cplusplus >= 201703L
+#if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__) || \
+ __cplusplus >= 201703L || defined(_AIX) && defined(_ALL_SOURCE)
# define FLT_TRUE_MIN __FLT_DENORM_MIN__
----------------
Same comment as above. Applies also to similar changes in the rest of the file.
================
Comment at: clang/test/Headers/float.c:7
// RUN: %clang_cc1 -fsyntax-only -verify -xc++ -std=c++17 -ffreestanding %s
+// RUN: %clang_cc1 -triple powerpc-ibm-aix -fsyntax-only -verify -std=c99 -ffreestanding -D_ALL_SOURCE %s
// expected-no-diagnostics
----------------
The changes to the test are for functionality that I do not believe should be present (see earlier comments).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117935/new/
https://reviews.llvm.org/D117935
More information about the cfe-commits
mailing list