C++ Logo

sg16

Advanced search

Re: [SG16] P2362R0 Make obfuscating wide character literals ill-formed

From: Peter Brett <pbrett_at_[hidden]>
Date: Wed, 14 Apr 2021 19:02:18 +0000
> -----Original Message-----
> From: SG16 <sg16-bounces_at_lists.isocpp.org> On Behalf Of Giuseppe D'Angelo
> via SG16
> Sent: 14 April 2021 19:50
>
> Hello,
>
> Il 14/04/21 18:04, Peter Brett via SG16 ha scritto:
> > Good suggestions. I’ve expanded and revised the paper to include a
> > discussion of clang & gcc behaviour with -fshort-wchar.
> >
>
> Pedantically, could it be possible to arrange the table so to know
> what's sizeof(wchar_t) for each entry?
>
> -fshort-wchar makes a difference only if the default size of wchar_t for
> the target platform wouldn't already be ushort. Otherwise, it doesn't
> make a difference (e.g. GCC/Clang targeting Windows)...?

Hi Giuseppe,

When running clang -target x86_64-win64-msvc, my experiments suggest that it's necessary to also pass -fshort-char in order to obtain 16-bit wchar_t.

I feel confident that readers will be able to figure it out. However, I'll update the paper in R1 as you suggest.

Best regards,

                 Peter

Received on 2021-04-14 14:02:38