develooper Front page | perl.perl5.porters | Postings from September 2000

[PATCH-R] was Re: SuSE's gcc-2.95.2 and //depot/perl

From:
Robin Barker
Date:
September 29, 2000 05:10
Subject:
[PATCH-R] was Re: SuSE's gcc-2.95.2 and //depot/perl
Message ID:
200009291210.NAA17098@tempest.npl.co.uk
> 
> Nick wrote
> > Building Tk with whatever is in the depot tonight is failing will 
> > gcc -Wall -Werror because Perl_croak() has had printf fromat checking 
> > attribute turned on and XS_VERSION_BOOTCHECK has %_ which isn't a legal 
> > printf format character.
> 
> That's my fault.
> I thought leaving the format checking attributes in would be OK.
> 
> I thought this would just lead to a few spurious error messages
> (with -Wformat), I didn't realise the people would try to compile
> with -Wall -Werror.
> 

The patch required is to undo the existing patch 7091.  I'm not 
sure how my original patch got split in two, but 7091 seems to
be solely the relevant change to embed.pl and the consequent
changes to proto.h.  7091 reproduced below.

Robin

This is 
http://public.activestate.com/gsar/APC/5.7.1/diffs/7091.gz

APPLY THIS PATCH WITH C<patch -R> to perl@7094 and beyond.

Change 7091 by jhi@alpha on 2000/09/14 23:33:24

	Part of #7081 didn't come through.

Affected files ...

... //depot/perl/embed.pl#160 edit
... //depot/perl/proto.h#234 edit

Differences ...

==== //depot/perl/embed.pl#160 (xtext) ====
Index: perl/embed.pl
--- perl/embed.pl.~1~	Thu Sep 14 17:42:52 2000
+++ perl/embed.pl	Thu Sep 14 17:42:52 2000
@@ -138,7 +138,7 @@
 	if( $flags =~ /f/ ) {
 	    my $prefix = $flags =~ /n/ ? '' : 'pTHX_';
 	    my $args = scalar @args;
-	    $ret .= "\n#ifdef CHECK_FORMAT\n";
+ 	    $ret .= "\n#ifdef HASATTRIBUTE\n";
 	    $ret .= sprintf " __attribute__((format(printf,%s%d,%s%d)))",
 				    $prefix, $args - 1, $prefix, $args;
 	    $ret .= "\n#endif\n";

==== //depot/perl/proto.h#234 (text+w) ====
Index: perl/proto.h
--- perl/proto.h.~1~	Thu Sep 14 17:42:52 2000
+++ perl/proto.h	Thu Sep 14 17:42:52 2000
@@ -104,75 +104,75 @@
 #endif
 PERL_CALLCONV OP*	Perl_convert(pTHX_ I32 optype, I32 flags, OP* o);
 PERL_CALLCONV void	Perl_croak(pTHX_ const char* pat, ...) __attribute__((noreturn))
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_vcroak(pTHX_ const char* pat, va_list* args) __attribute__((noreturn));
 #if defined(PERL_IMPLICIT_CONTEXT)
 PERL_CALLCONV void	Perl_croak_nocontext(const char* pat, ...) __attribute__((noreturn))
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV OP*	Perl_die_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_deb_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV char*	Perl_form_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_load_module_nocontext(U32 flags, SV* name, SV* ver, ...);
 PERL_CALLCONV SV*	Perl_mess_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_warn_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_warner_nocontext(U32 err, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
 PERL_CALLCONV SV*	Perl_newSVpvf_nocontext(const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,1,2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_sv_catpvf_nocontext(SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
 PERL_CALLCONV void	Perl_sv_setpvf_nocontext(SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
 PERL_CALLCONV void	Perl_sv_catpvf_mg_nocontext(SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
 PERL_CALLCONV void	Perl_sv_setpvf_mg_nocontext(SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
 PERL_CALLCONV int	Perl_fprintf_nocontext(PerlIO* stream, const char* fmt, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,2,3)))
 #endif
 ;
@@ -193,7 +193,7 @@
 PERL_CALLCONV PPADDR_t*	Perl_get_ppaddr(pTHX);
 PERL_CALLCONV I32	Perl_cxinc(pTHX);
 PERL_CALLCONV void	Perl_deb(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
@@ -205,7 +205,7 @@
 PERL_CALLCONV char*	Perl_delimcpy(pTHX_ char* to, char* toend, char* from, char* fromend, int delim, I32* retlen);
 PERL_CALLCONV void	Perl_deprecate(pTHX_ char* s);
 PERL_CALLCONV OP*	Perl_die(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
@@ -269,7 +269,7 @@
 PERL_CALLCONV OP*	Perl_force_list(pTHX_ OP* arg);
 PERL_CALLCONV OP*	Perl_fold_constants(pTHX_ OP* arg);
 PERL_CALLCONV char*	Perl_form(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
@@ -451,7 +451,7 @@
 PERL_CALLCONV char*	Perl_mem_collxfrm(pTHX_ const char* s, STRLEN len, STRLEN* xlen);
 #endif
 PERL_CALLCONV SV*	Perl_mess(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
@@ -545,7 +545,7 @@
 PERL_CALLCONV SV*	Perl_newSVpvn(pTHX_ const char* s, STRLEN len);
 PERL_CALLCONV SV*	Perl_newSVpvn_share(pTHX_ const char* s, STRLEN len, U32 hash);
 PERL_CALLCONV SV*	Perl_newSVpvf(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
@@ -714,7 +714,7 @@
 PERL_CALLCONV int	Perl_sv_backoff(pTHX_ SV* sv);
 PERL_CALLCONV SV*	Perl_sv_bless(pTHX_ SV* sv, HV* stash);
 PERL_CALLCONV void	Perl_sv_catpvf(pTHX_ SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_2,pTHX_3)))
 #endif
 ;
@@ -761,7 +761,7 @@
 PERL_CALLCONV void	Perl_sv_report_used(pTHX);
 PERL_CALLCONV void	Perl_sv_reset(pTHX_ char* s, HV* stash);
 PERL_CALLCONV void	Perl_sv_setpvf(pTHX_ SV* sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_2,pTHX_3)))
 #endif
 ;
@@ -817,13 +817,13 @@
 PERL_CALLCONV void	Perl_report_evil_fh(pTHX_ GV *gv, IO *io, I32 op);
 PERL_CALLCONV void	Perl_report_uninit(pTHX);
 PERL_CALLCONV void	Perl_warn(pTHX_ const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_1,pTHX_2)))
 #endif
 ;
 PERL_CALLCONV void	Perl_vwarn(pTHX_ const char* pat, va_list* args);
 PERL_CALLCONV void	Perl_warner(pTHX_ U32 err, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_2,pTHX_3)))
 #endif
 ;
@@ -861,7 +861,7 @@
 PERL_CALLCONV SV*	Perl_sv_lock(pTHX_ SV *sv);
 #endif
 PERL_CALLCONV void	Perl_sv_catpvf_mg(pTHX_ SV *sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_2,pTHX_3)))
 #endif
 ;
@@ -870,7 +870,7 @@
 PERL_CALLCONV void	Perl_sv_catpvn_mg(pTHX_ SV *sv, const char *ptr, STRLEN len);
 PERL_CALLCONV void	Perl_sv_catsv_mg(pTHX_ SV *dstr, SV *sstr);
 PERL_CALLCONV void	Perl_sv_setpvf_mg(pTHX_ SV *sv, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_2,pTHX_3)))
 #endif
 ;
@@ -886,7 +886,7 @@
 PERL_CALLCONV MGVTBL*	Perl_get_vtbl(pTHX_ int vtbl_id);
 PERL_CALLCONV char*	Perl_pv_display(pTHX_ SV *sv, char *pv, STRLEN cur, STRLEN len, STRLEN pvlim);
 PERL_CALLCONV void	Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...)
-#ifdef CHECK_FORMAT
+#ifdef HASATTRIBUTE
  __attribute__((format(printf,pTHX_3,pTHX_4)))
 #endif
 ;
End of Patch.


-- 
Robin Barker                        | Email: Robin.Barker@npl.co.uk
CMSC, Building 10,                  | Phone: +44 (0) 20 8943 7090
National Physical Laboratory,       | Fax:   +44 (0) 20 8977 7091
Teddington, Middlesex, UK. TW11 OLW | WWW:   http://www.npl.co.uk



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