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

[PATCH 5.9.0] to silence compiler warning

Thread Next
From:
Robin Barker
Date:
January 28, 2003 08:19
Subject:
[PATCH 5.9.0] to silence compiler warning
Message ID:
533D273D4014D411AB1D00062938C4D9040462CC@hotel.npl.co.uk

Patch against 18376.

scalar.xs	wrap assignment in if
Storable.xs	remove repeated use of PL_na
universal.c	use SVf (to hide %_ from -Wformat)
util.c	format uniformity

Robin


diff -ur ../perl@18376/ext/PerlIO/scalar/scalar.xs
./ext/PerlIO/scalar/scalar.xs
--- ../perl@18376/ext/PerlIO/scalar/scalar.xs   Mon Dec 23 01:35:53 2002
+++ ext/PerlIO/scalar/scalar.xs
@@ -216,7 +216,7 @@
        if (!f) {
            f = PerlIO_allocate(aTHX);
        }
-       if (f = PerlIO_push(aTHX_ f, self, mode, arg)) {
+       if ( (f = PerlIO_push(aTHX_ f, self, mode, arg)) ) {
            PerlIOBase(f)->flags |= PERLIO_F_OPEN;
        }
        return f;
diff -ur ../perl@18376/ext/Storable/Storable.xs
./ext/Storable/Storable.xs
--- ../perl@18376/ext/Storable/Storable.xs      Mon Nov 25 01:37:59 2002
+++ ext/Storable/Storable.xs
@@ -5008,7 +5008,8 @@
                        CROAK(("Unexpected return value from
$Storable::Eval callback\n"));
                cv = POPs;
                if (SvTRUE(errsv)) {
-                       CROAK(("code %s caused an error: %s", SvPV(sub,
PL_na), SvPV(errsv, PL_na)));
+                       CROAK(("code %s caused an error: %s",
+                               SvPV(sub, PL_na), SvPV_nolen(errsv)));
                }
                PUTBACK;
        } else {
diff -ur ../perl@18376/universal.c ./universal.c
--- ../perl@18376/universal.c   Mon Dec 23 05:13:49 2002
+++ universal.c
@@ -338,7 +338,8 @@
            req = new_version(req);
 
        if ( vcmp( SvRV(req), SvRV(sv) ) > 0 )
-           Perl_croak(aTHX_ "%s version %_ required--this is only
version %_",
+           Perl_croak(aTHX_
+               "%s version %"SVf" required--this is only version %"SVf,
                HvNAME(pkg), req, sv);
     }
 
diff -ur ../perl@18376/util.c ./util.c
--- ../perl@18376/util.c        Mon Dec 23 01:35:54 2002
+++ util.c
@@ -3931,14 +3931,14 @@
        return sv;
     }
     digit = SvIVX(*av_fetch((AV *)vs, 0, 0));
-    Perl_sv_setpvf(aTHX_ sv,"%d",digit);
+    Perl_sv_setpvf(aTHX_ sv,"%"IVdf,(IV)digit);
     for ( i = 1 ; i <= len ; i++ )
     {
        digit = SvIVX(*av_fetch((AV *)vs, i, 0));
        if ( digit < 0 )
-           Perl_sv_catpvf(aTHX_ sv,"_%d",-digit);
+           Perl_sv_catpvf(aTHX_ sv,"_%"IVdf,(IV)-digit);
        else
-           Perl_sv_catpvf(aTHX_ sv,".%d",digit);
+           Perl_sv_catpvf(aTHX_ sv,".%"IVdf,(IV)digit);
     }
     if ( len == 0 )
         Perl_sv_catpv(aTHX_ sv,".0");
End of patch

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