unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Matheus Castanho via Libc-alpha <libc-alpha@sourceware.org>
To: "Carlos O'Donell" <carlos@redhat.com>
Cc: Florian Weimer <fweimer@redhat.com>, libc-alpha@sourceware.org
Subject: Re: [PATCH v12 1/2] Add 'codepoint_collation' support for LC_COLLATE.
Date: Mon, 06 Sep 2021 14:20:57 -0300	[thread overview]
Message-ID: <878s097h8m.fsf@linux.ibm.com> (raw)
In-Reply-To: <20210906154336.610973-2-carlos@redhat.com>


Carlos O'Donell via Libc-alpha <libc-alpha@sourceware.org> writes:

> Support a new directive 'codepoint_collation' in the LC_COLLATE
> section of a locale source file. This new directive causes all
> collation rules to be dropped and instead STRCMP (strcmp or
> wcscmp) is used for collation of the input character set. This
> is required to allow for a C.UTF-8 that contains zero collation
> rules (minimal size) and sorts using code point sorting.
>
[...]

> diff --git a/locale/C-collate-seq.c b/locale/C-collate-seq.c
> new file mode 100644
> index 0000000000..4fb82cb835
> --- /dev/null
> +++ b/locale/C-collate-seq.c
> @@ -0,0 +1,100 @@
> +/* Copyright (C) 1995-2021 Free Software Foundation, Inc.
> +   This file is part of the GNU C Library.
> +
> +   The GNU C Library is free software; you can redistribute it and/or
> +   modify it under the terms of the GNU Lesser General Public
> +   License as published by the Free Software Foundation; either
> +   version 2.1 of the License, or (at your option) any later version.
> +
> +   The GNU C Library is distributed in the hope that it will be useful,
> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> +   Lesser General Public License for more details.
> +
> +   You should have received a copy of the GNU Lesser General Public
> +   License along with the GNU C Library; if not, see
> +   <https://www.gnu.org/licenses/>.  */
> +
> +#include <stdint.h>
> +
> +static const char collseqmb[] =
> +{
> +  '\x00', '\x01', '\x02', '\x03', '\x04', '\x05', '\x06', '\x07',
> +  '\x08', '\x09', '\x0a', '\x0b', '\x0c', '\x0d', '\x0e', '\x0f',
> +  '\x10', '\x11', '\x12', '\x13', '\x14', '\x15', '\x16', '\x17',
> +  '\x18', '\x19', '\x1a', '\x1b', '\x1c', '\x1d', '\x1e', '\x1f',
> +  '\x20', '\x21', '\x22', '\x23', '\x24', '\x25', '\x26', '\x27',
> +  '\x28', '\x29', '\x2a', '\x2b', '\x2c', '\x2d', '\x2e', '\x2f',
> +  '\x30', '\x31', '\x32', '\x33', '\x34', '\x35', '\x36', '\x37',
> +  '\x38', '\x39', '\x3a', '\x3b', '\x3c', '\x3d', '\x3e', '\x3f',
> +  '\x40', '\x41', '\x42', '\x43', '\x44', '\x45', '\x46', '\x47',
> +  '\x48', '\x49', '\x4a', '\x4b', '\x4c', '\x4d', '\x4e', '\x4f',
> +  '\x50', '\x51', '\x52', '\x53', '\x54', '\x55', '\x56', '\x57',
> +  '\x58', '\x59', '\x5a', '\x5b', '\x5c', '\x5d', '\x5e', '\x5f',
> +  '\x60', '\x61', '\x62', '\x63', '\x64', '\x65', '\x66', '\x67',
> +  '\x68', '\x69', '\x6a', '\x6b', '\x6c', '\x6d', '\x6e', '\x6f',
> +  '\x70', '\x71', '\x72', '\x73', '\x74', '\x75', '\x76', '\x77',
> +  '\x78', '\x79', '\x7a', '\x7b', '\x7c', '\x7d', '\x7e', '\x7f',
> +  '\x80', '\x81', '\x82', '\x83', '\x84', '\x85', '\x86', '\x87',
> +  '\x88', '\x89', '\x8a', '\x8b', '\x8c', '\x8d', '\x8e', '\x8f',
> +  '\x90', '\x91', '\x92', '\x93', '\x94', '\x95', '\x96', '\x97',
> +  '\x98', '\x99', '\x9a', '\x9b', '\x9c', '\x9d', '\x9e', '\x9f',
> +  '\xa0', '\xa1', '\xa2', '\xa3', '\xa4', '\xa5', '\xa6', '\xa7',
> +  '\xa8', '\xa9', '\xaa', '\xab', '\xac', '\xad', '\xae', '\xaf',
> +  '\xb0', '\xb1', '\xb2', '\xb3', '\xb4', '\xb5', '\xb6', '\xb7',
> +  '\xb8', '\xb9', '\xba', '\xbb', '\xbc', '\xbd', '\xbe', '\xbf',
> +  '\xc0', '\xc1', '\xc2', '\xc3', '\xc4', '\xc5', '\xc6', '\xc7',
> +  '\xc8', '\xc9', '\xca', '\xcb', '\xcc', '\xcd', '\xce', '\xcf',
> +  '\xd0', '\xd1', '\xd2', '\xd3', '\xd4', '\xd5', '\xd6', '\xd7',
> +  '\xd8', '\xd9', '\xda', '\xdb', '\xdc', '\xdd', '\xde', '\xdf',
> +  '\xe0', '\xe1', '\xe2', '\xe3', '\xe4', '\xe5', '\xe6', '\xe7',
> +  '\xe8', '\xe9', '\xea', '\xeb', '\xec', '\xed', '\xee', '\xef',
> +  '\xf0', '\xf1', '\xf2', '\xf3', '\xf4', '\xf5', '\xf6', '\xf7',
> +  '\xf8', '\xf9', '\xfa', '\xfb', '\xfc', '\xfd', '\xfe', '\xff'
> +};
> +
> +/* This table must be 256 bytes in size. We index bytes into the
> +   table to find the collation sequence.  */
> +_Static_assert (sizeof (collseqmb) == 256);

Hi Carlos,

glibc doesn't build after this patch went in, looks like the assert
message is missing:

In file included from C-collate.c:22:
C-collate-seq.c:58:42: error: expected ‘,’ before ‘)’ token
 _Static_assert (sizeof (collseqmb) == 256);
                                          ^

--
Matheus Castanho

  reply	other threads:[~2021-09-06 17:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-06 15:43 [PATCH v12 0/2] C.UTF-8 Carlos O'Donell via Libc-alpha
2021-09-06 15:43 ` [PATCH v12 1/2] Add 'codepoint_collation' support for LC_COLLATE Carlos O'Donell via Libc-alpha
2021-09-06 17:20   ` Matheus Castanho via Libc-alpha [this message]
2021-09-06 17:28     ` Florian Weimer via Libc-alpha
2021-09-07  1:28       ` Carlos O'Donell via Libc-alpha
2021-09-07  1:57     ` Carlos O'Donell via Libc-alpha
2021-09-20 12:49       ` Matheus Castanho via Libc-alpha
2021-09-20 12:54         ` Carlos O'Donell via Libc-alpha
2021-09-06 15:43 ` [PATCH v12 2/2] Add generic C.UTF-8 locale (Bug 17318) Carlos O'Donell via Libc-alpha
2022-01-26  2:44   ` Michael Hudson-Doyle via Libc-alpha
2022-01-28 16:42     ` Carlos O'Donell via Libc-alpha
2022-01-30 23:58       ` Michael Hudson-Doyle via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878s097h8m.fsf@linux.ibm.com \
    --to=libc-alpha@sourceware.org \
    --cc=carlos@redhat.com \
    --cc=fweimer@redhat.com \
    --cc=msc@linux.ibm.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).