[PATCH]: Implement fwide (was Re: swprintf() and friends?)

Jeff Johnston jjohnstn@redhat.com
Thu Dec 11 17:29:00 GMT 2008


Corinna Vinschen wrote:
> On Dec 10 15:40, Jeff Johnston wrote:
>   
>> Corinna Vinschen wrote:
>>     
>>> Jeff?
>>>
>>> Did you have a look in the meantime?
>>>
>>>   
>>>       
>> I actually was looking at this today.
>>
>> Couple of immediate points:
>>
>> 1. In ORIENT, you do a fp->flags != __SORD (should be "|= ")
>>     
>
> Ouch!  Thanks for spotting.
>
>   
>> 2. ORIENT should not check the value of ori.  It is only 0 in one case when 
>> fwide
>>    is used so fwide should check for 0 and not call ORIENT in that case.
>>     
>
> Fine with me.
>
>   
>> 3. There doesn't seem to be orientation for the printf family while the 
>> scanf family is covered
>>     via vfscanf.
>>     
>
> Hmm, you seem to be right.  I examined the FreeBSD sources again since I
> was pretty sure that the code path will result in calling ORIENT when
> calling any printf function.  But it really looks like printf doesn't
> set the orientation.  A bug in the FreeBSD sources?  __sfvwrite_r might
> be a good point to call ORIENT, right?
>
>   
I decided just to put it in _VFPRINT_R after the lock.  Seemed consistent.
>> I can fix these myself if you like or you can resubmit if you would like to 
>> test.
>>     
>
> I have no problems if you fix that.
>
>   
Done.  I also changed references to stdin and stdout in wchar.h so they 
basically expand as they do in stdio.h.

I think Craig's idea to move the functions to a wchar directory is a 
reasonable idea.  I am going to check the code in the stdio directory 
for now as we are really close to the snapshot and I have other things 
to do.  I want people to have a chance to find any problems before the 
snapshot and if I don't get a chance to do the move or run into any 
problems, the functions will be available.

Thanks Corinna for doing this.
> Thanks,
> Corinna
>
>   



More information about the Newlib mailing list