bug-coreutils
[Top][All Lists]
Advanced

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

printf %lld versus %Ld for Tandem NSK (OSS)


From: Paul Eggert
Subject: printf %lld versus %Ld for Tandem NSK (OSS)
Date: Wed, 11 Oct 2006 23:34:19 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Matthew Woehlke <address@hidden> writes:

> I guess it's "slow" if *any* 'build-and-run-a-test-program' test is
> "slow" (which, in all fairness, my OSS system takes 'real 0m5.363s...

5 seconds is a bit much, yes.  Plus, it'd be overhead we'd have
to do for _every_ host, at configure-time.

> according to /usr/include/xlocnum:
>
>                 #ifdef _TNS_R_TARGET /* 13feb2002 sjt */
>                         /*
>                            %lld for long long int is not
>                            supported on tns_r_targets yet
>                            use %Ld

As I understand it, _TNS_R_TARGET merely tells you that it's an R or S
series (MIPS based) as opposed to a newer E series (Itanium based)
hardware.  My guess is that all the E series machines support "%lld"
since they're newer.  Perhaps we can assume that all the R series
machines support "%Ld" (if only for backward compatibility).

We're already making a special case for Microsoft and Mingw32
here, so we might as well add Tandem NSK OSS to the throng.

For lack of better info I installed this to gnulib.  Can you find out
more about this, by looking at the Tandem documentation and/or asking
your Tandem support guys?  If you can, I'd like the "defined
_TNS_R_TARGET" to be more accurate.

2006-10-11  Paul Eggert  <address@hidden>

        * lib/inttypes_.h (_LONG_LONG_FORMAT_PREFIX): New macro.
        Add support for Tandem NonStop R series.
        (_PRI64_PREFIX, _PRIu64_PREFIX, _SCN64_PREFIX, _SCNu64_PREFIX):
        Use new macro.

--- lib/inttypes_.h     11 Oct 2006 05:58:47 -0000      1.4
+++ lib/inttypes_.h     12 Oct 2006 06:17:55 -0000      1.5
@@ -46,6 +46,16 @@
 
 #if ! defined __cplusplus || defined __STDC_FORMAT_MACROS
 
+# if defined _MSC_VER || defined __MINGW32__
+#  define _LONG_LONG_FORMAT_PREFIX "I64"
+# elif defined _TNS_R_TARGET
+   /* Tandem NonStop R series and compatible platforms released before
+      July 2005 support %Ld but not %lld.  */
+#  define _LONG_LONG_FORMAT_PREFIX "L"
+# else
+#  define _LONG_LONG_FORMAT_PREFIX "ll"
+# endif
+
 # if !defined PRId8 || @PRI_MACROS_BROKEN@
 #  undef PRId8
 #  ifdef INT8_MAX
@@ -157,10 +167,8 @@
 # ifdef INT64_MAX
 #  if INT64_MAX == LONG_MAX
 #   define _PRI64_PREFIX "l"
-#  elif defined _MSC_VER || defined __MINGW32__
-#   define _PRI64_PREFIX "I64"
 #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _PRI64_PREFIX "ll"
+#   define _PRI64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined PRId64 || @PRI_MACROS_BROKEN@
 #   undef PRId64
@@ -174,10 +182,8 @@
 # ifdef UINT64_MAX
 #  if UINT64_MAX == ULONG_MAX
 #   define _PRIu64_PREFIX "l"
-#  elif defined _MSC_VER || defined __MINGW32__
-#   define _PRIu64_PREFIX "I64"
 #  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-#   define _PRIu64_PREFIX "ll"
+#   define _PRIu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined PRIo64 || @PRI_MACROS_BROKEN@
 #   undef PRIo64
@@ -650,10 +656,8 @@
 # ifdef INT64_MAX
 #  if INT64_MAX == LONG_MAX
 #   define _SCN64_PREFIX "l"
-#  elif defined _MSC_VER || defined __MINGW32__
-#   define _SCN64_PREFIX "I64"
 #  elif @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
-#   define _SCN64_PREFIX "ll"
+#   define _SCN64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined SCNd64 || @PRI_MACROS_BROKEN@
 #   undef SCNd64
@@ -667,10 +671,8 @@
 # ifdef UINT64_MAX
 #  if UINT64_MAX == ULONG_MAX
 #   define _SCNu64_PREFIX "l"
-#  elif defined _MSC_VER || defined __MINGW32__
-#   define _SCNu64_PREFIX "I64"
 #  elif @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
-#   define _SCNu64_PREFIX "ll"
+#   define _SCNu64_PREFIX _LONG_LONG_FORMAT_PREFIX
 #  endif
 #  if !defined SCNo64 || @PRI_MACROS_BROKEN@
 #   undef SCNo64




reply via email to

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