This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #12986] Clarify that scanf does not use character classes.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 5 Nov 2013 15:14:47 +0100
- Subject: Re: [PATCH][BZ #12986] Clarify that scanf does not use character classes.
- Authentication-results: sourceware.org; auth=none
- References: <20131021073442 dot GA21616 at domone dot podge> <20131025211509 dot C6B87746B6 at topped-with-meat dot com>
On Fri, Oct 25, 2013 at 02:15:09PM -0700, Roland McGrath wrote:
> > [BZ #12986]
> > * manual/stdio.texi: Clarify documentation.
>
> Such a vague log entry is wholly inadequate. Log entries for Texinfo
> files should cite the node in the same way log entries for C files
> cite the function. That alone is still insufficiently specific.
> Say what you're clarifying.
>
> > diff --git a/manual/stdio.texi b/manual/stdio.texi
> > index 30630ca..1be5fd9 100644
> > --- a/manual/stdio.texi
> > +++ b/manual/stdio.texi
> > @@ -3671,8 +3671,8 @@ of the width or precision by @code{MB_CUR_MAX}.
> >
> > To read in characters that belong to an arbitrary set of your choice,
> > use the @samp{%[} conversion. You specify the set between the @samp{[}
> > -character and a following @samp{]} character, using the same syntax used
> > -in regular expressions. As special cases:
> > +character and a following @samp{]} character, using similar syntax an one
> > +used in regular expressions. As special cases:
>
> I'd say, "... using the same syntax used in regular expressions for
> explicit sets of characters."
>
> > +Note that character classes are not supported.
>
> The term "character class" is not defined anywhere in this manual
> (unsurprising since it does not document regexp syntax). You could
> use a cross-reference to another manual that does document regexp
> syntax and define the term (there is surely a good node to refer to in
> the grep manual). But it's also nice to make it clear without looking
> up the reference, e.g.
>
> Note that the @dfn{character class} syntax available in character sets
> that appear inside regular expressions (such as @samp{[:alpha:]}) is
> @emph{not} available in the @samp{%[} conversion.
Here is v2.
[BZ #12986]
* manual/stdio.texi (String Input Conversions): Clarify that character
classes are not supported.
diff --git a/manual/stdio.texi b/manual/stdio.texi
index 30630ca..7dcacd8 100644
--- a/manual/stdio.texi
+++ b/manual/stdio.texi
@@ -3672,7 +3672,7 @@ of the width or precision by @code{MB_CUR_MAX}.
To read in characters that belong to an arbitrary set of your choice,
use the @samp{%[} conversion. You specify the set between the @samp{[}
character and a following @samp{]} character, using the same syntax used
-in regular expressions. As special cases:
+in regular expressions for explicit sets of characters. As special cases:
@itemize @bullet
@item
@@ -3692,6 +3692,10 @@ the characters listed.
The @samp{%[} conversion does not skip over initial whitespace
characters.
+Note that the @dfn{character class} syntax available in character sets
+that appear inside regular expressions (such as @samp{[:alpha:]}) is
+@emph{not} available in the @samp{%[} conversion.
+
Here are some examples of @samp{%[} conversions and what they mean:
@table @samp