RE: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Bernd Edlinger
> On 11/07/13 09:32, Dodji Seketeli wrote: > >> From the above, what I can say is that input.o was already linked with >> gcov. But I think it's minimal enough to only drag libcpp and the >> diagnostic subsystem. > > I disagree. While input.o was available to gcov, I don't think it was being > pull

RE: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Bernd Edlinger
On Thu, 7 Nov 2013 13:48:14, Jakub Jelinek wrote: > On Thu, Nov 07, 2013 at 01:25:00PM +0100, Bernd Edlinger wrote: >> just some thoughts... >> >> >> fgetc will definitely be much faster than fread 16K and fseek back to the >> end of line position. >> >> Note: fgetc is already buffered and not too

Re: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Jakub Jelinek
On Thu, Nov 07, 2013 at 01:25:00PM +0100, Bernd Edlinger wrote: > just some thoughts... > > > fgetc will definitely be much faster than fread 16K and fseek back to the end > of line position. > > Note: fgetc is already buffered and not too slow on average, but only if you > do not > fseek arou

RE: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Bernd Edlinger
Hi, just some thoughts... fgetc will definitely be much faster than fread 16K and fseek back to the end of line position. Note: fgetc is already buffered and not too slow on average, but only if you do not fseek around. In that case the buffered file-stream data is lost. Well, reading 16K in

Re: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Dodji Seketeli
I was a bit too hasty in committing this patch, thinking the review was done. I have reverted it yesterday night. Let's try again after a night of sleep. Bernd Edlinger writes: > I still do not see how this is supposed to work: > > If the previous invocation of get_line already had read some >

Re: [PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-07 Thread Jakub Jelinek
On Thu, Nov 07, 2013 at 07:17:19AM +, Nathan Sidwell wrote: > On 11/06/13 21:25, Dodji Seketeli wrote: > >It appeared that gcov.c and input.c both have a static function named > >read_line. I guess we ought to keep just one. > > As a general rule, that's good. Generally yes, but IMHO not in

[PATCH] Factorize the two read_line functions present in gcov.c and input.c

2013-11-06 Thread Dodji Seketeli
Hello, It appeared that gcov.c and input.c both have a static function named read_line. I guess we ought to keep just one. So I changed the one in input.c as it handles lines with bytes of zero value (as of the work on PR preprocessor/58580) to make it suitable for what the uses of read_line in