bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnulib] full-write.c / full-read.c consolidation


From: Bruno Haible
Subject: Re: [Bug-gnulib] full-write.c / full-read.c consolidation
Date: Wed, 8 Jan 2003 13:55:17 +0100 (CET)

Jim Meyering writes:
> Any objection to this?
> 
>       * full-write.c: Rework so that it may serve to define full_read, too.
>       * full-read.c: Simply #define FULL_READ and include full-write.c.
> 
> With the above change, full-read.c is just two lines (modulo copyright):

Nothing against unification of duplicated code - where it is
duplicated and not only similar. But here, when 50% of the resulting
code is #ifdef'ed, my gut feeling is that we are going too far. The
#ifdef spaghetti is harder to maintain than the two earlier functions.

> # undef const
> # define const /* empty */

I think it would be safer to do this after including <errno.h>, not
before. You never know what <errno.h> contains.

>   const char *ptr = buf;
> 
>   while (count > 0)

Any reason why you undid the "really nothing to do if count == 0"
optimization that I had put in?

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]