We actually have a portable version of asprintf() in the OMPI code base. On
platforms that don't support asprintf(), the configure magically swaps in
the OMPI equivalent.
On 9/12/06 6:07 AM, "Christian Siebert"
> Hi again,
> there is a tiny portability problem located in ompi/tools/ompi_info/param.cc.
> This code uses the asprintf() function, which is a GNU extension and
> therefore not very portable. Fortunately, it is not hard to exchange
> the line
> asprintf(&value_string, "%d", value_int);
> with a separate buffer allocation and the ANSI C function sprintf()
> (although I'd prefer a pre-allocated buffer). Tip: an integer (whether
> signed or unsigned) has at most ceil(sizeof(int)*2.41) decimal digits
> (don't forget the trailing null byte!).
> PS: Thanks Jeff for filing the last bug I've mailed.
> devel mailing list
Server Virtualization Business Unit