bug-gnulib
[Top][All Lists]
Advanced

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

Re: portability of 'printf' command


From: Dr. David Kirkby
Subject: Re: portability of 'printf' command
Date: Tue, 06 Apr 2010 00:42:38 +0100
User-agent: Thunderbird 2.0.0.21 (X11/20090323)

Eric Blake wrote:
On 01/-10/-28163 12:59 PM, Bruno Haible wrote:
Is the 'printf' command portable enough to be used in configure files
and autoconf macros?

The GNU Coding Standards [1] don't mention it as a portable utility. Indeed,
when you use bash version 1 (which does not have 'printf' built-in) on a
platform that does not have a /usr/bin/printf program, you would be hosed.
But which platforms are this? The Autoconf manual [2] does not mention a lack
of 'printf' anywhere.

Is someone aware of a platform that does not have a /usr/bin/printf or
/bin/printf program?

Given that Solaris 8 is about as far back as gnulib currently supports,
I think we are at the point where the known lack of printf(1) in older
Solaris is no longer worth worrying about.  And, given that we document
that awk is safe to use in Makefiles, in spite of its portability
problems, I don't think it is too much of a stretch to support careful
use of printf in portable scripting (the Autoconf manual already does a
good job at documenting considerations to be careful of before using
printf).  So, does this patch seem reasonable?

There are quite a few pre Solaris 8 systems around - since Solaris tends to be used for mission-critical applications, it is often not wise to update them just because a new release has extra features.




reply via email to

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