[PATCH] nano version of sscanf does not work with %F %G and %E (capital letters) specifiers

Corinna Vinschen vinschen@redhat.com
Mon Feb 8 09:26:00 GMT 2016


On Feb  2 13:55, Igor Venevtsev wrote:
> Here is test case and expected output produced by host gcc:
> 
> bash-4.3$ cat nano-sscanf-F-E-G.c && gcc nano-sscanf-F-E-G.c && ./a.out
> #include <stdio.h>
> 
> float F = 0, E = 0, G = 0;
> 
> int main()
> {
>     char *in = "356.3e+2\n";
>     sscanf(in, "%F\n", &F);
>     sscanf(in, "%E\n", &E);
>     sscanf(in, "%G\n", &G);
>     fprintf(stderr, ":%F: :%E: :%G:\n", F, E, G);
>     return 0;
> }
> [...]
> Here is an output produced by newlib configured with
> --newlib-enable-nano-formatted-io knob:
> bash-4.3$ gcc -m32 nano-sscanf-F-E-G.c -I i386-elf/include/ -nostdlib
> i386-elf/lib/libc.a i386-elf/lib/libnosys.a -u _printf_float -u
> _scanf_float && ./a.out
> 
> :F-07: :4.988623E-43: :4.98862E-43:
> 
> Please find a patch in attachment
> 
> Thanks, Igor

Patch applied.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
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://sourceware.org/pipermail/newlib/attachments/20160208/3cb5bfd4/attachment.sig>


More information about the Newlib mailing list