[PATCH 2/3]: C++20 P0482R6 and C2X N2653: Implement mbrtoc8, c8rtomb, char8_t

Joseph Myers joseph@codesourcery.com
Mon Jun 7 18:53:46 GMT 2021


On Sun, 6 Jun 2021, Tom Honermann via Libc-alpha wrote:

> This patch provides implementations for the mbrtoc8 and c8rtomb functions
> adopted for C++20 via WG21 P0482R6 [1] and proposed for C2X via WG14 N2653
> [2].  It also provides the char8_t typedef from WG14 N2653 [2] and introduces
> a _CHAR8_T_SOURCE feature test macro to opt-in to the new declarations.

What's the reason for adding _CHAR8_T_SOURCE?  We don't normally have 
feature test macros for such narrow features (_ATFILE_SOURCE is not a good 
example to follow).

Any new feature test macro needs documenting in creature.texi - but I 
think it would be better not to add a new feature test macro in the first 
place.  _GNU_SOURCE is suitable for a proposed-but-not-yet-adopted (or a 
feature in a future standard version for which we don't yet have feature 
test macro support), if in a particular case we get consensus to add the 
feature without it having been accepted for the standard.

> Additionally, in features.h, missing comments for the __GLIBC_USE_ISOC2X,
> __GLIBC_USE_DEPRECATED_GETS, and __GLIBC_USE_DEPRECATED_SCANF macros are
> added.

These are covered by the description of __GLIBC_USE (F).  I don't think 
the __GLIBC_USE_* forms should have their own comments, since the version 
calling __GLIBC_USE is what should be tested everywhere in the headers.

> +/* Copyright (C) 2020 Free Software Foundation, Inc.

Copyright dates should include 2021.  Each file should have a line before 
the copyright notice describing its contents.

+   Contributed by Tom Honermann <tom@honermann.net>, 2020.

We don't use "Contributed by" any more in glibc.

-- 
Joseph S. Myers
joseph@codesourcery.com


More information about the Libc-alpha mailing list