[parted-devel] avoid printf, when easy to do

Debarshi Ray debarshi.ray at gmail.com
Wed Feb 14 11:08:38 CET 2007


> > Your proposed changes looks right but I do think we should provide a
> > method to make it easier?

> It's a one time conversion, so making the transition "easier"
> is less important than making the resulting code readable.
> Also, with the standard functions, you won't have to publicize
> the new interface if/when you want to use the same technique
> in another .c file.

I agree with Jim. fputs is both ANSI-C and POSIX.1 compliant, so it is
better to stick to standard functions.

> I see your point (reducing syntax, which is good), but I'd rather not
> add a nonstandard name that some readers might think still supports
> printf-style format strings.  Everyone knows what fputs does, and if you
> omit the FILE* argument, the preprocessor will gripe right away.  Also,
> I prefer to avoid using va_* functions, unless there's a clear need.
>
> However, if you'd rather skip the suggested change altogether,
> go right ahead.  As I said, it's not a big deal.

If it results in more efficient code, then I would like to have it. :-)

Happy hacking,
Debarshi
-- 
After the game the king and the pawn go into the same box.
                -- Italian proverb



More information about the parted-devel mailing list