# New Ticket Created by Petter Reinholdtsen # Please include the string: [perl #22189] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=22189 > 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 miniperlmain.c: 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 compilable: #include <stdio.h> void croak (char* pat,...) __attribute__((format(printf,1,2),noreturn)); 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,...) __attribute__((format(printf,1,2),noreturn)); +void croak (char* pat,...) __attribute__((__format__(__printf__,1,2),noreturn)); EOCP 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 __attribute__." + echo "Your C compiler doesn't fully support __attribute__." >&4 val="$undef" else - echo "Your C compiler supports __attribute__." + echo "Your C compiler supports __attribute__." >&4 val="$define" fi else - 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 val="$undef" fi set d_attribut