From 713c2a319ad7f8fc97935d93d3d9965c0df9a69b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 28 Jul 2004 06:58:25 +0000 Subject: (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. --- src/printf.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/printf.c') 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. */ -- cgit v1.2.3-54-g00ecf