develooper Front page | perl.perl5.porters | Postings from May 2003

RE: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX ( broken attribute test)

Thread Previous
Robin Barker
May 14, 2003 10:48
RE: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX ( broken attribute test)
Message ID:
The format attributes are not normally visible to the compiler.
Unless you are using -DCHECK_FORMAT, the __printf__ are not seen.
The attribute setting in perlio.h were not protected by 
C<ifdef CHECK_FORMAT> -- this is a bug and was fixed by my
patch 18556.


-----Original Message-----
From: Petter Reinholdtsen []
Sent: 13 May 2003 19:42
Subject: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX
(broken attribute test)

# New Ticket Created by  Petter Reinholdtsen 
# Please include the string:  [perl #22189]
# in the subject line of all future correspondence about this issue. 
# <URL: >

I ran into a compile error when trying to compile perl 5.8.0 on ia64
HP/UX 11.22.  I got this error message when trying to compile

  Error 172: "perlio.h", line 209 # Undeclared variable '__printf__'.

The problem was the following code:

    __attribute__ ((__format__(__printf__, 1, 2)));

Tracking the problem further, I discovered the test for __attribute__
in Configure, where it is testing if the following construct is

  #include <stdio.h>
  void croak (char* pat,...)

I also discovered that the result from this test isn't printed to
stdout, making it hard to find out what the result from this test was.

I belive the test in Configure should test for the same feature that
is used in the perl code, and rewrote 'format' to '__format__' and
'printf' to '__printf__' to match perlio.h.  I also printed the result
of the test to stdout, making it easy see that this test now fails as
it should on HP/UX.

With the following patch, I got past the previous problem area.
Please include this patch in the next version of perl.

diff -ur src-5.8.0/Configure src-5.8.0-local/Configure
--- src-5.8.0/Configure	2002-07-19 00:55:15.000000000 +0200
+++ src-5.8.0-local/Configure	2003-05-13 20:23:30.000000000 +0200
@@ -9382,18 +9382,18 @@
 echo "Checking whether your compiler can handle __attribute__ ..." >&4
 $cat >attrib.c <<'EOCP'
 #include <stdio.h>
-void croak (char* pat,...)
+void croak (char* pat,...)
 if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
 	if $contains 'warning' attrib.out >/dev/null 2>&1; then
-		echo "Your C compiler doesn't fully support
+		echo "Your C compiler doesn't fully support
__attribute__." >&4
-		echo "Your C compiler supports __attribute__."
+		echo "Your C compiler supports __attribute__." >&4
-	echo "Your C compiler doesn't seem to understand __attribute__
at all."
+	echo "Your C compiler doesn't seem to understand __attribute__
at all." >&4
 set d_attribut

This e-mail and any attachments may contain confidential and/or
privileged material; it is for the intended addressee(s) only.
If you are not a named addressee, you must not use, retain or
disclose such information.

NPL Management Ltd cannot guarantee that the e-mail or any
attachments are free from viruses.

NPL Management Ltd. Registered in England and Wales. No: 2937881
Registered Office: Teddington, Middlesex, United Kingdom TW11 0LW.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About