[PATCH] D146148: Float_t and double_t types shouldn't be modified by #pragma clang fp eval_method

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 7 14:07:02 PDT 2023


rjmccall added inline comments.


================
Comment at: clang/docs/LanguageExtensions.rst:4371
+incorrect code, leading to an ABI mismatch. This case is prevented by emitting a
+diagnostic.
+
----------------
Suggestion:

```
``math.h`` defines the typedefs ``float_t`` and ``double_t`` based on the active
evaluation method at the point where the header is included, not where the
typedefs are used.  Because of this, it is unwise to combine these typedefs with
``#pragma clang fp eval_method``.  To catch obvious bugs, Clang will emit an
error for any references to these typedefs within the scope of this pragma;
however, this is not a fool-proof protection, and programmers must take care.
```


================
Comment at: clang/include/clang/Basic/IdentifierTable.h:96
 
+  unsigned InterestingIdentifierID : 5;
+
----------------
The suggestion was to use a range of values within `ObjCOrBuiltinID` rather than adding
storage to all identifiers.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146148/new/

https://reviews.llvm.org/D146148



More information about the cfe-commits mailing list