From: Joseph Myers <joseph@codesourcery.com>
To: <Paul.Koning@dell.com>
Cc: <eliz@gnu.org>, <simark@simark.ca>, <zjz@zjz.name>,
<gdb-patches@sourceware.org>
Subject: Re: support C/C++ identifiers named with non-ASCII characters
Date: Mon, 21 May 2018 20:43:00 -0000 [thread overview]
Message-ID: <alpine.DEB.2.20.1805212007370.30181@digraph.polyomino.org.uk> (raw)
In-Reply-To: <FCEC48CC-5F04-438F-9B6C-2D8933E64A97@dell.com>
[-- Attachment #1: Type: text/plain, Size: 1619 bytes --]
On Mon, 21 May 2018, Paul.Koning@dell.com wrote:
> I don't know what the C/C++ standards say about non-ASCII identifiers.
> I assume they are stated to be Unicode, and presumably specific Unicode
They are defined in terms of ISO 10646 (and so concepts from Unicode that
don't appear in ISO 10646, such as normalization forms, are not relevant
to them).
See C11 Annex D, which is also aligned with C++11 and later (older
standard versions had generally more restrictive sets of allowed
characters, different for C and C++, based on TR 10176).
> Yet another issue: for many characters, there are multiple ways to
> represent them in Unicode. For example, ü (latin small letter u with
> dieresis) can be coded as the single Unicode character 0xfc, or as the
> pair 0x0308 0x75 (combining dieresis, latin small letter u). These are
(The letter goes before the combining mark in that case, not after. Thus
such combining marks are not generally permitted at the start of
identifiers.)
> supposed to be synonymous; when doing string matches, you'd want them to
They are *not* synonymous in C or C++. (GCC has -Wnormalized= options to
warn about identifiers not in an appropriate normalization form, with
-Wnormalized=nfc as the default.)
GCC always generates UTF-8 in its .s output for such identifiers, which
gas then transfers straight through to its output (thus, UTF-8 ELF
symbols). The generic ELF ABI is silent on the encoding of such symbols
(it just says "External C symbols have the same names in C and object
files' symbol tables.").
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2018-05-21 20:27 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-21 9:54 張俊芝
2018-05-21 14:21 ` Simon Marchi
2018-05-21 15:27 ` Paul.Koning
2018-05-21 16:16 ` Eli Zaretskii
2018-05-21 18:34 ` Paul.Koning
[not found] ` <83tvr0ev0p.fsf@gnu.org>
2018-05-21 19:25 ` Paul.Koning
2018-05-21 20:43 ` Joseph Myers [this message]
2018-05-22 10:31 ` 張俊芝
2018-05-22 8:34 ` 張俊芝
[not found] ` <1b915196-3e97-4892-7426-be4211fe7889@zjz.name>
2018-05-21 18:00 ` 張俊芝
2018-05-21 18:03 ` 張俊芝
2018-05-21 18:14 ` Matt Rice
2018-05-22 7:06 ` 張俊芝
2018-05-22 14:39 ` Pedro Alves
2018-05-22 14:39 ` 張俊芝
2018-05-22 15:17 ` Pedro Alves
2018-05-22 16:42 ` Pedro Alves
2018-05-22 17:31 ` 張俊芝
2018-05-22 17:38 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.20.1805212007370.30181@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=Paul.Koning@dell.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
--cc=zjz@zjz.name \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox