Subject: bug#12753: closed (Re: bug#12753: printf in make-prime-list.c uses "modern" features)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 04 Nov 2012 00:59:02 +0000

Your bug report

#12753: printf in make-prime-list.c uses "modern" features

which was filed against the coreutils package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
12753: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=12753
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#12753: printf in make-prime-list.c uses "modern" features
From: Pádraig Brady <[email-masked]>
To: John David Anglin <[email-masked]>
Cc: John David Anglin <[email-masked]>, [email-masked]
Date: Sun, 04 Nov 2012 00:55:17 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

On 10/29/2012 12:22 PM, John David Anglin wrote:
> On 28-Oct-12, at 9:57 PM, Pádraig Brady wrote:
>
>> Is %jx not supported, or is the * not supported with %j?
>> I'm guessing the latter since you got a runtime issue
>> rather than a compile time one.  We also use '*' in
>> other format strings, so I doubt that's an issue in itself.
>
>
> I will test this evening.  The printf manpage doesn't mention %j
> or * in the HP-UX 10.20 and 11.11 pages.  Sometimes things
> are supported but not documented.

I've now pushed the patch set from this thread,
so I'm marking this as done.

cheers,
Pádraig.

Subject: printf in make-prime-list.c uses "modern" features
From: John David Anglin <[email-masked]>
To: [email-masked]
Cc: John David Anglin <[email-masked]>
Date: Sun, 28 Oct 2012 15:40:23 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

make-prime-list crashes on hppa1.1-hp-hpux10.20.  This probably
will occur on any hppa-hpux system.

Attached is a hack to work around the problem.

Dave
-- 
J. David Anglin                                  [email-masked]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)
--- make-prime-list.c.orig	Tue Oct 23 10:14:12 2012
+++ make-prime-list.c	Sat Oct 27 16:10:30 2012
@@ -84,10 +84,17 @@
       unsigned int d8 = i + 8 < nprimes ? primes[i + 8].p - primes[i].p : 0xff;
       if (255 < d8) /* this happens at 668221 */
         abort ();
+#ifdef __hppa
+      printf ("P (%2u, %3u, 0x%016llx%s, 0x%016llx%s) /* %d */\n",
+              primes[i].p - p, d8,
+              primes[i].pinv, suffix,
+              primes[i].lim, suffix, primes[i].p);
+#else
       printf ("P (%2u, %3u, 0x%0*jx%s, 0x%0*jx%s) /* %d */\n",
               primes[i].p - p, d8,
               SZ, primes[i].pinv, suffix,
               SZ, primes[i].lim, suffix, primes[i].p);
+#endif
       p = primes[i].p;
     }