Effect of -fexec-charset with C++11 string literals

Marvin Gülker m-guelker@phoenixmail.de
Fri Oct 28 09:53:00 GMT 2016


On Thu, Oct 27, 2016 at 07:46:04PM +0100, Jonathan Wakely wrote:
> IMHO it's not necessary, because strings encoded in UTF-8 are encoded
> in UTF-8, by definition. So it's redundant to say "strings with a
> specific encoding have that encoding, not the encoding of the
> execution character set".

Currently, the manpage says for -fexec-charset:

> Set the execution character set, used for string and character
> constants.  The default is UTF-8.  charset can be any encoding
> supported by the system's "iconv" library routine.

This explanation uses an absolute wording ("used for string and
character constants") that makes me expect that it affects *all* string
and character constants, possibly overriding what was set by u8 et
al. It was what drove me to ask the question on this list as I wasn't
sure whether there was something overlooked when implementing the c++11
standard in GCC, or intentionally extended. A simple addition such as
"This option does not affect string and character constants prefixed
with u8, u, or U, which are always stored in in the executable in the
charset requested by each respective prefix" would make any
misunderstanding impossible. To that end, I don't find the explanation
redundant.

Greetings
Marvin

-- 
Blog: http://www.guelkerdev.de
PGP/GPG ID: F1D8799FBCC8BC4F



More information about the Gcc-help mailing list