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]

scanf() is not working properly with latest snapshot of newlib.


Hi,

	We are working on GNU based toolchain using newlib.
Our toolchain was working fine with Newlib-1.15.0. but now I am facing  
problems with latest snapshot of newlib.

	The problem is that scanf() is not working properly in latest
snapshot of newlib.
  
int main ( void )
{          
 char string[10];
 
 while(1)
 {
   scanf("%s",&string);
   printf("%s\r\n",string);
 }
 return 0;
}


When I compiled and debugged the above sample code with latest snapshot
of newlib then I  found that it doesn't invoke _read() system call.It
returns back from _svfscanf_r without further entering into _serfill_r,
_smakebuf, _fstat_r, _malloc_r, _sbrk_r and then _sread, _read_r,_read
etc. 

The toolchain with older newlib (1.15.0 ) invokes all these functions
properly.

When we tested the code on hardware, scanf() returns prematurely and as
a result the printf() prints invalid output.  

Anyone have any idea about this?

Thanks in advance.

--Bhushan


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