bug-coreutils
[Top][All Lists]
Advanced

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

bug#13030: factor: infinite loop on Linux/powerpc


From: Pádraig Brady
Subject: bug#13030: factor: infinite loop on Linux/powerpc
Date: Mon, 07 Jan 2013 02:09:12 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

On 01/04/2013 02:47 PM, Pádraig Brady wrote:
So what I'm going to do is pull all the _LP64 amendments to longlong.h
and instead avoid it completely with this in factor.c:

diff --git a/src/factor.c b/src/factor.c
index 473eee7..95451a5 100644
--- a/src/factor.c
+++ b/src/factor.c
@@ -118,7 +118,14 @@
  #endif

  #ifndef USE_LONGLONG_H
-# define USE_LONGLONG_H 1
+/* With the way we use longlong.h, it's only safe to use
+   when UWtype = UHWtype, as there were various cases
+   (as can be seen in the history for longlong.h) where
+   for example, _LP64 was required to enable W_TYPE_SIZE==64 code,
+   to avoid compile time or run time issues.  */
+# if LONG_MAX == INTMAX_MAX
+#  define USE_LONGLONG_H 1
+# endif
  #endif

  #if USE_LONGLONG_H

That works for i686 x86_64 and sparcv7 and sparcv9 at least.

No comments, so I'm pushing the attached.

thanks,
Pádraig.

Attachment: factor-asm-general.diff
Description: Text Data


reply via email to

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