This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] manual: Document %m instead of %a for formatted input.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: "Joseph S. Myers" <joseph at codesourcery dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, Ville Skytta <ville dot skytta at iki dot fi>, libc-alpha at sourceware dot org
- Date: Wed, 19 Feb 2014 16:00:33 +0100
- Subject: Re: [PATCH] manual: Document %m instead of %a for formatted input.
- Authentication-results: sourceware.org; auth=none
- References: <20140211140022 dot GB22794 at domone dot podge> <20140211173249 dot 9BA1174451 at topped-with-meat dot com> <20140219135720 dot GD29125 at domone dot podge> <Pine dot LNX dot 4 dot 64 dot 1402191436110 dot 3311 at digraph dot polyomino dot org dot uk>
On Wed, Feb 19, 2014 at 02:40:23PM +0000, Joseph S. Myers wrote:
> On Wed, 19 Feb 2014, Ondrej Bilka wrote:
>
> > @@ -3929,18 +3933,21 @@ input with a comprehensible error message, not with a crash.
> > @node Dynamic String Input
> > @subsection Dynamically Allocating String Conversions
> >
> > -A GNU extension to formatted input lets you safely read a string with no
> > -maximum size. Using this feature, you don't supply a buffer; instead,
> > -@code{scanf} allocates a buffer big enough to hold the data and gives
> > -you its address. To use this feature, write @samp{a} as a flag
> > -character, as in @samp{%as} or @samp{%a[0-9a-z]}.
> > +Since ISO C-1990 there is feature to safely read a string with no maximum
> > +size. Using this feature, you don't supply a buffer; instead, @code{scanf}
> > +allocates a buffer big enough to hold the data and gives you its address.
> > +To use this feature, write @samp{m} as a flag character, as in
> > +@samp{%ms}, @samp{%m10c} or @samp{%m[0-9a-z]}.
>
> It's not C90, or C99, or C11. It's a POSIX (new in the 2008 edition)
> feature, also present in the C TR 24731-2:2010 which was not (unlike
> 24731-1) integrated in C11.
>
The original version had POSIX in it. Roland said that its part of C
standard. So what should be there not keep changing that back and forth?