bug-make
[Top][All Lists]
Advanced

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

Re: [rfc] Colorized output for GNU make?


From: Paul Smith
Subject: Re: [rfc] Colorized output for GNU make?
Date: Mon, 13 Feb 2012 11:41:36 -0500

On Sun, 2012-02-12 at 19:34 +0200, Eli Zaretskii wrote:
> > Date: Sun, 12 Feb 2012 18:11:49 +0100
> > From: Sebastian Pipping <address@hidden>
> > CC: address@hidden, address@hidden
> > 
> > Since we would run into buffer overflows with sprintf/vsprintf, we
> > rely on snprintf/vsnprintf for that task.  Quoting from my "man 3
> > printf" output:
> > 
> >   snprintf(), vsnprintf():
> >     _BSD_SOURCE || _XOPEN_SOURCE >= 500 || _ISOC99_SOURCE \
> >       || _POSIX_C_SOURCE >= 200112L;
> >     or cc -std=c99
> > 
> > That's my understanding of the situation.
> 
> If all you need is vsnprintf, I think you can rely on it being
> present, and if it isn't, disable argument reordering on that
> platform.  Or we could import one from libiberty or from gnulib, I
> guess.  Paul?

I don't see any good way to support systems without vsnprintf(), if we
decide to depend on it, except for writing a lot of yucky ifdef'd code
scattered throughout the codebase.

If we have vsnprintf() we can abstract away the construction of the
string into a general function.  If we don't, we have to do it down at
the very lowest level and pass va_lists around, which means the function
signature of the lowest-level functions will have to be different, etc.

Pulling in an implementation from gnulib, just in case, might be the way
to go.




reply via email to

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