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)

From:
Andy Dougherty
Date:
May 14, 2003 07:25
Subject:
Re: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX (broken attribute test)
Message ID:
Pine.SOL.4.53.0305141010320.22305@maxwell.phys.lafayette.edu
On Tue, 13 May 2003, Petter Reinholdtsen wrote:

> 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 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.

Unfortunately, both forms (format and __format__) are used in the perl
code.  I don't know why.  Nor do I understand why your compiler would
accept one but not the other.  That's truly strange, and probably worth
investigating.  Does your compiler actually support
__attribute__((format())) but not __attribute__((__format__())), or is the
test flawed in some other way such that __attribute__ isn't supported, but
we fail to adequately detect that.

> 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.

Actually, it does print the result.  You just told Configure to suppress
that information by supplying the -s switch to Configure.  Configure
similarly suppresses other outputs from the "Checking ..." sorts of tests.
If you don't want Configure to suppress information, don't supply the -s
switch.

In short, I have no objection to changing format to __format__ and
printf to __printf__, but it'd be nice to know just why it matters so that
we can make the test more robust so that this issue wouldn't have
come up in the first place.

-- 
    Andy Dougherty		doughera@lafayette.edu



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About