This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [[C++ PATCH]] Implement C++2a P0330R2 - Literal Suffixes for ptrdiff_t and size_t
- From: Florian Weimer <fweimer at redhat dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Joseph S. Myers" <joseph at codesourcery dot com>, Jason Merrill <jason at redhat dot com>, nathan at acm dot org
- Date: Tue, 23 Oct 2018 11:22:06 +0200
- Subject: Re: [[C++ PATCH]] Implement C++2a P0330R2 - Literal Suffixes for ptrdiff_t and size_t
- References: <7fe5ef20-0fd5-605a-408f-8894d2fa7a73@verizon.net>
* Ed Smith-Rowland:
> This patch implements C++2a proposal P0330R2 Literal Suffixes for
> ptrdiff_t and size_t*. It's not official yet but looks very likely to
> pass. It is incomplete because I'm looking for some opinions. 9We
> also might wait 'till it actually passes).
>
> This paper takes the direction of a language change rather than a
> library change through C++11 literal operators. This was after
> feedback on that paper after a few iterations.
>
> As coded in this patch, integer suffixes involving 'z' are errors in C
> and warnings for C++ <= 17 (in addition to the usual warning about
> implementation suffixes shadowing user-defined ones).
So a plain z would denote ptrdiff_t, and size_t would be zu? That is
very confusing.
Why is this not consistent with %td, %zd and %zu? I would have expected
t for ptrdiff_t, zu for size_t, and z for ssize_t.
Thanks,
Florian