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 Next
From:
Robin Barker
Date:
May 19, 2003 05:55
Subject:
RE: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX ( broken attribute test)
Message ID:
533D273D4014D411AB1D00062938C4D904046524@hotel.npl.co.uk
Nick

Something needs to change -- at the moment
nostdio.h defines 'printf' as 'CANNOT _printf_', so
'format(printf,1,2)' becomes 'format(CANNOT _printf_,1,2)'
which does not parse.  (You only get this with -DCHECK_FORMAT.)

Using '__printf__' seemed the neated way to fix this.

Robin

-----Original Message-----
From: Nick Ing-Simmons [mailto:nick@ing-simmons.net]
Sent: 17 May 2003 18:39
To: Robin.Barker@npl.co.uk
Cc: 'Andy Dougherty'; perl5-porters@perl.org
Subject: RE: [perl #22189] patch: perl 5.8.0 compile error on ia64/HP-UX
( broken attribute test)


Robin Barker <Robin.Barker@npl.co.uk> writes:
>Hi
>
>I changed 'printf' to '__printf__' in the format enabled by CHECKFORMAT
>because the 'printf' was caught up in stdio/sfio MACRO merry-go-round.
>
>I could have changed format but it wasn't a problem, and I didn't know 
>it was an option.
>
>I think the remaining 'format's and 'printf's should be changed to
>'__format__' and '__printf__', including in Configure.
>
>Robin

That depends if HP/UX really undestands the forms without the __
then why should we limit ourselves to the gcc-ish __ forms?



>
>-----Original Message-----
>From: Andy Dougherty [mailto:doughera@lafayette.edu]
>Sent: 14 May 2003 15:26
>To: perl5-porters@perl.org
>Subject: Re: [perl #22189] patch: perl 5.8.0 compile error on
ia64/HP-UX
>(broken attribute test)
>
>
>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
>
>-------------------------------------------------------------------
>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.
>-------------------------------------------------------------------
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/

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


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