[PATCH] D31856: Headers: Make the type of SIZE_MAX the same as size_t

Duncan P. N. Exon Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 20 16:35:48 PDT 2017


dexonsmith added a comment.

Thanks for the review.  `__SIZE_MAX__` makes sense to me; and better even if not for the `#if` requirement.  I'll do that for both `SIZE_MAX` and `PTRDIFF_MAX` when I get a chance.



================
Comment at: clang/test/Preprocessor/stdint.c:1411
 // JOIN:PTRDIFF_MAX_ 2147483647
-// JOIN:SIZE_MAX_ 4294967295U
+// JOIN:SIZE_MAX_ ((unsigned a)4294967295U)
 // JOIN:INTMAX_MIN_ (-9223372036854775807LL -1)
----------------
rsmith wrote:
> Do we really define `__SIZE_TYPE__` to `unsigned a` for some target?
This testcase has a `#define int a` to confirm that we get `intmax_t` from our token pasting instead of `amax_t`.  `unsigned a` looks bogus, but I figure such a user is getting what they asked for.


https://reviews.llvm.org/D31856





More information about the cfe-commits mailing list