scanf and m modifier

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Jul 11 09:56:00 GMT 2016


On Jul  8 11:42, Eric Blake wrote:
> On 07/08/2016 11:22 AM, Eliot Moss wrote:
> > On 7/8/2016 1:16 PM, Owen Leibman wrote:
> >> The m modifier is handled just fine by the compiler, but
> >> the results of using it are different on Cygwin than on several other
> >> systems
> >> I've tried. Here is a sample program:
> > 
> > Dear Owen -- The first question I'd ask is: What versions of gcc
> > and C libraries are we talking about?  IIRC, the m feature is
> > relatively new (relative being, umm, relative), so which gcc you're
> > using, and the libraries, too, may matter.
> 
> scanf("%ms") is a POSIX extension, not required by C99.  I suspect the
> answer is that no one has implemented it in newlib yet; patches welcome.

Indeed, the 'm' modifier isn't implemented in newlib yet.  However, the
vfscanf code, while being a bot more convoluted than FreeBSD/NetBSD to
support small targets, is still based on FreeBSD and NetBSD.  It might
be possible to port the 'm' handling from one of them with moderate
effort.

Anybody here who'd like to do that?

Just send your patch to the newlib AT sourceware DOT org mailing list 
and we're looking it over for inclusion.


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160711/306a4549/attachment.sig>


More information about the Cygwin mailing list