[clang] 92e1723 - [clang][Headers] Only define FLT_EVAL_METHOD for C99 and later

Adhemerval Zanella via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 8 08:58:58 PST 2022


Author: Adhemerval Zanella
Date: 2022-11-08T13:58:37-03:00
New Revision: 92e172309cf6624487ef6b3a79aeeee5445276f9

URL: https://github.com/llvm/llvm-project/commit/92e172309cf6624487ef6b3a79aeeee5445276f9
DIFF: https://github.com/llvm/llvm-project/commit/92e172309cf6624487ef6b3a79aeeee5445276f9.diff

LOG: [clang][Headers] Only define FLT_EVAL_METHOD for C99 and later

It was reported by glibc conform test [1].

[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=conform/data/float.h-data;h=7b98fc03447b8918da4a0cf47d41fb3e17f4f791;hb=HEAD

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D137267

Added: 
    

Modified: 
    clang/lib/Headers/float.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/Headers/float.h b/clang/lib/Headers/float.h
index 5dace7a47c9fa..0e73bca0a2d6e 100644
--- a/clang/lib/Headers/float.h
+++ b/clang/lib/Headers/float.h
@@ -86,7 +86,10 @@
 
 /* Characteristics of floating point types, C99 5.2.4.2.2 */
 
+#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) ||              \
+    (defined(__cplusplus) && __cplusplus >= 201103L)
 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
+#endif
 #define FLT_ROUNDS (__builtin_flt_rounds())
 #define FLT_RADIX __FLT_RADIX__
 


        


More information about the cfe-commits mailing list