[PATCH] wrap #ifdef for C99 around iswspace and mbrtowc in vfscanf.c

Jeff Johnston jjohnstn@redhat.com
Wed Oct 15 21:48:00 GMT 2008


Hello,

Unfortunately the WANT_IO_C99_FORMATS flag was added to keep additional 
formats like %C from
eating up space in the existing printf/scanf family.  Support for %lc 
and %ls was already in
place by then and so putting the logic under that flag may cause 
existing platform applications to
fail as only a few platforms have that flag turned on.

I have made a fix to the code to check the ELIX level flag that is 
provided in newlib.h.  If defined and
less than 2, then the code is #ifdef'd out.

-- Jeff J.

litb_devel@web.de wrote:
> Hello List,
>
> while working on my port of newlib, i got undefined references to those 
> functions. That happened because i compile newlib using EL/IX level 1, which 
> causes them not to be defined. 
> I wrapped the portion that prints wide characters/strings with  
> _WANT_IO_C99_FORMATS, just like it's already done while parsing the format 
> string. Please be kind, it's my first patch/diff for newlib. :)
> have fun, litb.
>
> Index: libc/stdio/vfscanf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/stdio/vfscanf.c,v
> retrieving revision 1.40
> diff -r1.40 vfscanf.c
> 824a825
>   
>> #ifdef _WANT_IO_C99_FORMATS
>>     
> 863c864,866
> <           else if (flags & SUPPRESS)
> ---
>   
>>           else
>> #endif /* _WANT_IO_C99_FORMATS */
>>           if (flags & SUPPRESS)
>>     
> 952a956
>   
>> #ifdef _WANT_IO_C99_FORMATS
>>     
> 1001c1005,1007
> <           else if (flags & SUPPRESS)
> ---
>   
>>           else
>> #endif /* _WANT_IO_C99_FORMATS */
>>           if (flags & SUPPRESS)
>>     
>
>
>
>   



More information about the Newlib mailing list