summaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2004-07-28 06:58:25 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2004-07-28 06:58:25 +0000
commit713c2a319ad7f8fc97935d93d3d9965c0df9a69b (patch)
tree993f6b2b7a29eb5a307d607410a3522da7463440 /src/printf.c
parent2cc7823212ad5c077bdb1978f117dbdb99153113 (diff)
downloadcoreutils-713c2a319ad7f8fc97935d93d3d9965c0df9a69b.tar.xz
(strtiomax, strtoumax): Declare if not already
declared: this fixes a portability bug with Solaris 8 + GCC. (STRTOX): Parenthesize use of macro arg as expression. (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary parentheses.
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/printf.c b/src/printf.c
index 6a3a37a58..62e85d98d 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -57,6 +57,13 @@
#include "error.h"
#include "unicodeio.h"
+#if ! (HAVE_DECL_STRTOIMAX || defined strtoimax)
+intmax_t strtoimax ();
+#endif
+#if ! (HAVE_DECL_STRTOUMAX || defined strtoumax)
+uintmax_t strtoumax ();
+#endif
+
/* The official name of this program (e.g., no `g' prefix). */
#define PROGRAM_NAME "printf"
@@ -177,15 +184,15 @@ FUNC_NAME (char const *s) \
else \
{ \
errno = 0; \
- val = LIB_FUNC_EXPR; \
+ val = (LIB_FUNC_EXPR); \
verify (s, end); \
} \
return val; \
} \
-STRTOX (intmax_t, vstrtoimax, (strtoimax (s, &end, 0)))
-STRTOX (uintmax_t, vstrtoumax, (strtoumax (s, &end, 0)))
-STRTOX (long double, vstrtold, (c_strtold (s, &end)))
+STRTOX (intmax_t, vstrtoimax, strtoimax (s, &end, 0))
+STRTOX (uintmax_t, vstrtoumax, strtoumax (s, &end, 0))
+STRTOX (long double, vstrtold, c_strtold (s, &end))
/* Output a single-character \ escape. */