This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]