unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Andreas Schwab <schwab@suse.de>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] wcsmbs: Avoid escaped character literals in <wchar.h>
Date: Mon, 17 Feb 2020 13:47:22 +0100	[thread overview]
Message-ID: <87blpxcrdx.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <mvm5zg577f2.fsf@suse.de> (Andreas Schwab's message of "Mon, 17 Feb 2020 12:57:37 +0100")

* Andreas Schwab:

> On Feb 17 2020, Florian Weimer wrote:
>
>> They confuse scripts/conformtest.py because it treats the L and the
>
> s/scripts/conform/
>
>> x7f as namespace-violating identifiers.
>
> Can the script be fixed not to do that?

Like this?

A more elaborate alternative would be to use Zack's C tokenizer in the
conform tests, but I don't know if its feature set is aligned with
what we need in the conform tests.

Subject: Add wide and character literal support to conform/conformtest.py

Without this change, tokens such as L'x7f' are reconginzed as a
identifiers L, x7f, which are not in the implementation namespace and
therefore trigger failures.

diff --git a/conform/conformtest.py b/conform/conformtest.py
index 951e3b2420..3bdc2a8e57 100644
--- a/conform/conformtest.py
+++ b/conform/conformtest.py
@@ -638,7 +638,7 @@ class HeaderTests(object):
                 # constants, and hex floats may be wrongly split into
                 # tokens including identifiers, but this is sufficient
                 # in practice and matches the old perl script.
-                line = re.sub(r'"[^"]*"', '', line)
+                line = re.sub(r'(?:\bL)?(?:"[^"]*"|\'[^\']*\')', '', line)
                 line = line.strip()
                 for token in re.split(r'[^A-Za-z0-9_]+', line):
                     if re.match(r'[A-Za-z_]', token):

  reply	other threads:[~2020-02-17 12:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-17 10:57 [PATCH] wcsmbs: Avoid escaped character literals in <wchar.h> Florian Weimer
2020-02-17 11:57 ` Andreas Schwab
2020-02-17 12:47   ` Florian Weimer [this message]
2020-02-17 16:06     ` Andreas Schwab

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=87blpxcrdx.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=libc-alpha@sourceware.org \
    --cc=schwab@suse.de \
    /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).