This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Sun Studio lint patches
authorAndy Lester <andy@petdance.com>
Mon, 13 Feb 2006 23:46:17 +0000 (17:46 -0600)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Tue, 14 Feb 2006 10:00:36 +0000 (10:00 +0000)
Message-ID: <20060214054617.GA8824@petdance.com>

p4raw-id: //depot/perl@27177

13 files changed:
Makefile.SH
gv.c
hv.c
op.c
pad.c
perlio.c
pp.c
pp_ctl.c
pp_hot.c
regcomp.c
sv.c
toke.c
utf8.c

index 0003490..354fa80 100644 (file)
@@ -364,6 +364,8 @@ lintflags = \
     -p \
     -Ncheck=%all \
     -Nlevel=4 \
     -p \
     -Ncheck=%all \
     -Nlevel=4 \
+    -errchk=parentheses \
+    -errhdr=%all \
     -errfmt=src \
     -errtags \
     -erroff=E_ASSIGN_NARROW_CONV \
     -errfmt=src \
     -errtags \
     -erroff=E_ASSIGN_NARROW_CONV \
diff --git a/gv.c b/gv.c
index 955891b..555260f 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -968,6 +968,7 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags,
     if (len > 1) {
 #ifndef EBCDIC
        if (*name > 'V' ) {
     if (len > 1) {
 #ifndef EBCDIC
        if (*name > 'V' ) {
+           /*EMPTY*/;
            /* Nothing else to do.
               The compiler will probably turn the switch statement into a
               branch table. Make sure we avoid even that small overhead for
            /* Nothing else to do.
               The compiler will probably turn the switch statement into a
               branch table. Make sure we avoid even that small overhead for
@@ -1468,7 +1469,7 @@ Perl_Gv_AMupdate(pTHX_ HV *stash)
        lim = DESTROY_amg;              /* Skip overloading entries. */
 #ifdef PERL_DONT_CREATE_GVSV
     else if (!sv) {
        lim = DESTROY_amg;              /* Skip overloading entries. */
 #ifdef PERL_DONT_CREATE_GVSV
     else if (!sv) {
-       /* Equivalent to !SvTRUE and !SvOK  */
+       /*EMPTY*/;   /* Equivalent to !SvTRUE and !SvOK  */
     }
 #endif
     else if (SvTRUE(sv))
     }
 #endif
     else if (SvTRUE(sv))
diff --git a/hv.c b/hv.c
index 061d0ce..f8d5851 100644 (file)
--- a/hv.c
+++ b/hv.c
@@ -2541,7 +2541,7 @@ Perl_hv_assert(pTHX_ HV *hv)
     }
     /* sanity check the keys */
     if (HeSVKEY(entry)) {
     }
     /* sanity check the keys */
     if (HeSVKEY(entry)) {
-      /* Don't know what to check on SV keys.  */
+      /*EMPTY*/ /* Don't know what to check on SV keys.  */
     } else if (HeKUTF8(entry)) {
       withflags++;
        if (HeKWASUTF8(entry)) {
     } else if (HeKUTF8(entry)) {
       withflags++;
        if (HeKWASUTF8(entry)) {
diff --git a/op.c b/op.c
index 9668905..2830834 100644 (file)
--- a/op.c
+++ b/op.c
@@ -462,11 +462,7 @@ S_cop_free(pTHX_ COP* cop)
        SvREFCNT_dec(cop->cop_warnings);
     if (! specialCopIO(cop->cop_io)) {
 #ifdef USE_ITHREADS
        SvREFCNT_dec(cop->cop_warnings);
     if (! specialCopIO(cop->cop_io)) {
 #ifdef USE_ITHREADS
-#if 0
-       STRLEN len;
-        char *s = SvPV(cop->cop_io,len);
-       Perl_warn(aTHX_ "io='%.*s'",(int) len,s); /* ??? --jhi */
-#endif
+       /*EMPTY*/
 #else
        SvREFCNT_dec(cop->cop_io);
 #endif
 #else
        SvREFCNT_dec(cop->cop_io);
 #endif
@@ -1580,7 +1576,7 @@ S_apply_attrs(pTHX_ HV *stash, SV *target, OP *attrs, bool for_my)
        /* Don't force the C<use> if we don't need it. */
        SV * const * const svp = hv_fetchs(GvHVn(PL_incgv), ATTRSMODULE_PM, FALSE);
        if (svp && *svp != &PL_sv_undef)
        /* Don't force the C<use> if we don't need it. */
        SV * const * const svp = hv_fetchs(GvHVn(PL_incgv), ATTRSMODULE_PM, FALSE);
        if (svp && *svp != &PL_sv_undef)
-                     /* already in %INC */
+           /*EMPTY*/;          /* already in %INC */
        else
            Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
                             newSVpvs(ATTRSMODULE), NULL);
        else
            Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
                             newSVpvs(ATTRSMODULE), NULL);
@@ -2003,7 +1999,7 @@ Perl_localize(pTHX_ OP *o, I32 lex)
 #if 0
        list(o);
 #else
 #if 0
        list(o);
 #else
-       ;
+       /*EMPTY*/;
 #endif
     else {
        if ( PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ','
 #endif
     else {
        if ( PL_bufptr > PL_oldbufptr && PL_bufptr[-1] == ','
@@ -2926,7 +2922,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, bool isreg)
                        repl_has_vars = 1;
                    }
                    else if (curop->op_type == OP_PUSHRE)
                        repl_has_vars = 1;
                    }
                    else if (curop->op_type == OP_PUSHRE)
-                       ; /* Okay here, dangerous in newASSIGNOP */
+                       /*EMPTY*/; /* Okay here, dangerous in newASSIGNOP */
                    else
                        break;
                }
                    else
                        break;
                }
@@ -5520,7 +5516,7 @@ Perl_ck_ftst(pTHX_ OP *o)
     const I32 type = o->op_type;
 
     if (o->op_flags & OPf_REF) {
     const I32 type = o->op_type;
 
     if (o->op_flags & OPf_REF) {
-       /* nothing */
+       /*EMPTY*/;
     }
     else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
        SVOP * const kid = (SVOP*)cUNOPo->op_first;
     }
     else if (o->op_flags & OPf_KIDS && cUNOPo->op_first->op_type != OP_STUB) {
        SVOP * const kid = (SVOP*)cUNOPo->op_first;
@@ -7507,6 +7503,7 @@ const_sv_xsub(pTHX_ CV* cv)
     dVAR;
     dXSARGS;
     if (items != 0) {
     dVAR;
     dXSARGS;
     if (items != 0) {
+       /*EMPTY*/;
 #if 0
         Perl_croak(aTHX_ "usage: %s::%s()",
                    HvNAME_get(GvSTASH(CvGV(cv))), GvNAME(CvGV(cv)));
 #if 0
         Perl_croak(aTHX_ "usage: %s::%s()",
                    HvNAME_get(GvSTASH(CvGV(cv))), GvNAME(CvGV(cv)));
diff --git a/pad.c b/pad.c
index 0a446db..50fa42c 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -848,7 +848,7 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn,
 
        SvNV_set(new_namesv, (NV)0);
        if (SvFLAGS(new_namesv) & SVpad_OUR) {
 
        SvNV_set(new_namesv, (NV)0);
        if (SvFLAGS(new_namesv) & SVpad_OUR) {
-          /* do nothing */
+           /*EMPTY*/;   /* do nothing */
        }
        else if (CvLATE(cv)) {
            /* delayed creation - just note the offset within parent pad */
        }
        else if (CvLATE(cv)) {
            /* delayed creation - just note the offset within parent pad */
index 30a40cb..9fa5dea 100644 (file)
--- a/perlio.c
+++ b/perlio.c
@@ -2289,6 +2289,8 @@ PerlIO_init(pTHX)
  /* Place holder for stdstreams call ??? */
 #ifdef USE_THREADS
     MUTEX_INIT(&PerlIO_mutex);
  /* Place holder for stdstreams call ??? */
 #ifdef USE_THREADS
     MUTEX_INIT(&PerlIO_mutex);
+#else
+    PERL_UNUSED_ARG(my_perl);
 #endif
 }
 
 #endif
 }
 
@@ -2542,6 +2544,7 @@ PerlIOUnix_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers,
     }
     else {
        if (f) {
     }
     else {
        if (f) {
+           /*EMPTY*/;
            /*
             * FIXME: pop layers ???
             */
            /*
             * FIXME: pop layers ???
             */
@@ -2918,6 +2921,7 @@ PerlIOStdio_dup(pTHX_ PerlIO *f, PerlIO *o, CLONE_PARAMS *param, int flags)
                goto set_this;
            }
            else {
                goto set_this;
            }
            else {
+               /*EMPTY*/;
                /* FIXME: To avoid messy error recovery if dup fails
                   re-use the existing stdio as though flag was not set
                 */
                /* FIXME: To avoid messy error recovery if dup fails
                   re-use the existing stdio as though flag was not set
                 */
@@ -3233,6 +3237,7 @@ PerlIOStdio_flush(pTHX_ PerlIO *f)
        return PerlSIO_fflush(stdio);
     }
     else {
        return PerlSIO_fflush(stdio);
     }
     else {
+       /*EMPTY*/;
 #if 0
        /*
         * FIXME: This discards ungetc() and pre-read stuff which is not
 #if 0
        /*
         * FIXME: This discards ungetc() and pre-read stuff which is not
@@ -4360,6 +4365,7 @@ PerlIOCrlf_set_ptrcnt(pTHX_ PerlIO *f, STDCHAR * ptr, SSize_t cnt)
        ptr -= cnt;
     }
     else {
        ptr -= cnt;
     }
     else {
+       /*EMPTY*/;
 #if 0
        /*
         * Test code - delete when it works ...
 #if 0
        /*
         * Test code - delete when it works ...
diff --git a/pp.c b/pp.c
index 83e0463..9eaac05 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -1046,6 +1046,7 @@ PP(pp_multiply)
            bhigh = blow >> (4 * sizeof (UV));
            blow &= botmask;
            if (ahigh && bhigh) {
            bhigh = blow >> (4 * sizeof (UV));
            blow &= botmask;
            if (ahigh && bhigh) {
+               /*EMPTY*/;
                /* eg 32 bit is at least 0x10000 * 0x10000 == 0x100000000
                   which is overflow. Drop to NVs below.  */
            } else if (!ahigh && !bhigh) {
                /* eg 32 bit is at least 0x10000 * 0x10000 == 0x100000000
                   which is overflow. Drop to NVs below.  */
            } else if (!ahigh && !bhigh) {
@@ -3474,6 +3475,7 @@ PP(pp_lc)
 
 #define GREEK_CAPITAL_LETTER_SIGMA 0x03A3 /* Unicode U+03A3 */
                if (uv == GREEK_CAPITAL_LETTER_SIGMA) {
 
 #define GREEK_CAPITAL_LETTER_SIGMA 0x03A3 /* Unicode U+03A3 */
                if (uv == GREEK_CAPITAL_LETTER_SIGMA) {
+                   /*EMPTY*/
                     /*
                      * Now if the sigma is NOT followed by
                      * /$ignorable_sequence$cased_letter/;
                     /*
                      * Now if the sigma is NOT followed by
                      * /$ignorable_sequence$cased_letter/;
index 1ebea19..2b207e4 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1913,7 +1913,7 @@ PP(pp_leaveloop)
 
     TAINT_NOT;
     if (gimme == G_VOID)
 
     TAINT_NOT;
     if (gimme == G_VOID)
-       ; /* do nothing */
+       /*EMPTY*/; /* do nothing */
     else if (gimme == G_SCALAR) {
        if (mark < SP)
            *++newsp = sv_mortalcopy(*SP);
     else if (gimme == G_SCALAR) {
        if (mark < SP)
            *++newsp = sv_mortalcopy(*SP);
index fb200e3..8f11e00 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2505,7 +2505,7 @@ PP(pp_leavesublv)
            EXTEND_MORTAL(SP - newsp);
            for (mark = newsp + 1; mark <= SP; mark++) {
                if (SvTEMP(*mark))
            EXTEND_MORTAL(SP - newsp);
            for (mark = newsp + 1; mark <= SP; mark++) {
                if (SvTEMP(*mark))
-                   /* empty */ ;
+                   /*EMPTY*/;
                else if (SvFLAGS(*mark) & (SVs_PADTMP | SVf_READONLY))
                    *mark = sv_mortalcopy(*mark);
                else {
                else if (SvFLAGS(*mark) & (SVs_PADTMP | SVf_READONLY))
                    *mark = sv_mortalcopy(*mark);
                else {
index 625479c..bb109fe 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -1015,7 +1015,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs
                });
 
            } else {
                });
 
            } else {
-               /* Its a dupe. So ignore it. */
+               /*EMPTY*/;   /* It's a dupe. So ignore it. */
            }
 
         } /* end second pass */
            }
 
         } /* end second pass */
@@ -1221,7 +1221,7 @@ S_make_trie(pTHX_ RExC_state_t *pRExC_state, regnode *startbranch, regnode *firs
                 });
 
             } else {
                 });
 
             } else {
-                /* Its a dupe. So ignore it. */
+               /*EMPTY*/;  /* Its a dupe. So ignore it. */
             }
 
         } /* end second pass */
             }
 
         } /* end second pass */
@@ -2946,7 +2946,7 @@ Perl_pregcomp(pTHX_ char *exp, char *xend, PMOP *pm)
       again:
        if (PL_regkind[(U8)OP(first)] == EXACT) {
            if (OP(first) == EXACT)
       again:
        if (PL_regkind[(U8)OP(first)] == EXACT) {
            if (OP(first) == EXACT)
-                     /* Empty, get anchored substr later. */
+               /*EMPTY*/;      /* Empty, get anchored substr later. */
            else if ((OP(first) == EXACTF || OP(first) == EXACTFL))
                r->regstclass = first;
        }
            else if ((OP(first) == EXACTF || OP(first) == EXACTFL))
                r->regstclass = first;
        }
@@ -5798,7 +5798,9 @@ Perl_regprop(pTHX_ SV *sv, const regnode *o)
                       PL_colors[0],
                       len, s,
                       PL_colors[1]);
                       PL_colors[0],
                       len, s,
                       PL_colors[1]);
-    } else if (k == TRIE) {/*
+    } else if (k == TRIE) {
+       /*EMPTY*/;
+       /*
        this isn't always safe, as Pl_regdata may not be for this regex yet
        (depending on where its called from) so its being moved to dumpuntil
        I32 n = ARG(o);
        this isn't always safe, as Pl_regdata may not be for this regex yet
        (depending on where its called from) so its being moved to dumpuntil
        I32 n = ARG(o);
diff --git a/sv.c b/sv.c
index 8c18a83..17b7b3d 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -1920,7 +1920,7 @@ S_sv_2iuv_common(pTHX_ SV *sv) {
                 if ((NV)(SvIVX(sv)) == SvNVX(sv)) {
                     SvIOK_on(sv);
                 } else {
                 if ((NV)(SvIVX(sv)) == SvNVX(sv)) {
                     SvIOK_on(sv);
                 } else {
-                    /* Integer is imprecise. NOK, IOKp */
+                   /*EMPTY*/;  /* Integer is imprecise. NOK, IOKp */
                 }
                 /* UV will not work better than IV */
             } else {
                 }
                 /* UV will not work better than IV */
             } else {
@@ -1935,7 +1935,7 @@ S_sv_2iuv_common(pTHX_ SV *sv) {
                     if ((NV)(SvUVX(sv)) == SvNVX(sv)) {
                         SvIOK_on(sv);
                     } else {
                     if ((NV)(SvUVX(sv)) == SvNVX(sv)) {
                         SvIOK_on(sv);
                     } else {
-                        /* Integer is imprecise. NOK, IOKp, is UV */
+                       /*EMPTY*/;   /* Integer is imprecise. NOK, IOKp, is UV */
                     }
                 }
                SvIsUV_on(sv);
                     }
                 }
                SvIsUV_on(sv);
@@ -3135,6 +3135,7 @@ S_glob_assign_ref(pTHX_ SV *dstr, SV *sstr) {
                           it was a const and its value changed. */
                        if (CvCONST(cv) && CvCONST((CV*)sref)
                            && cv_const_sv(cv) == cv_const_sv((CV*)sref)) {
                           it was a const and its value changed. */
                        if (CvCONST(cv) && CvCONST((CV*)sref)
                            && cv_const_sv(cv) == cv_const_sv((CV*)sref)) {
+                           /*EMPTY*/
                            /* They are 2 constant subroutines generated from
                               the same constant. This probably means that
                               they are really the "same" proxy subroutine
                            /* They are 2 constant subroutines generated from
                               the same constant. This probably means that
                               they are really the "same" proxy subroutine
@@ -9537,13 +9538,12 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
 
            switch (sv_type) {
            default:
 
            switch (sv_type) {
            default:
-               Perl_croak(aTHX_ "Bizarre SvTYPE [%" IVdf "]",
-                          (IV)SvTYPE(sstr));
+               Perl_croak(aTHX_ "Bizarre SvTYPE [%" IVdf "]", (IV)SvTYPE(sstr));
                break;
 
            case SVt_PVGV:
                if (GvUNIQUE((GV*)sstr)) {
                break;
 
            case SVt_PVGV:
                if (GvUNIQUE((GV*)sstr)) {
-                   /* Do sharing here, and fall through */
+                   /*EMPTY*/;   /* Do sharing here, and fall through */
                }
            case SVt_PVIO:
            case SVt_PVFM:
                }
            case SVt_PVIO:
            case SVt_PVFM:
@@ -9643,6 +9643,7 @@ Perl_sv_dup(pTHX_ const SV *sstr, CLONE_PARAMS* param)
                    if (IoDIRP(dstr)) {
                        IoDIRP(dstr)    = dirp_dup(IoDIRP(dstr));
                    } else {
                    if (IoDIRP(dstr)) {
                        IoDIRP(dstr)    = dirp_dup(IoDIRP(dstr));
                    } else {
+                       /*EMPTY*/;
                        /* IoDIRP(dstr) is already a copy of IoDIRP(sstr)  */
                    }
                }
                        /* IoDIRP(dstr) is already a copy of IoDIRP(sstr)  */
                    }
                }
diff --git a/toke.c b/toke.c
index 39eb52e..f11ed32 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -3319,7 +3319,7 @@ Perl_yylex(pTHX)
 #ifdef USE_ITHREADS
                            GvUNIQUE_on(cGVOPx_gv(yylval.opval));
 #else
 #ifdef USE_ITHREADS
                            GvUNIQUE_on(cGVOPx_gv(yylval.opval));
 #else
-                           ; /* skip to avoid loading attributes.pm */
+                           /*EMPTY*/;    /* skip to avoid loading attributes.pm */
 #endif
                        else
                            Perl_croak(aTHX_ "The 'unique' attribute may only be applied to 'our' variables");
 #endif
                        else
                            Perl_croak(aTHX_ "The 'unique' attribute may only be applied to 'our' variables");
diff --git a/utf8.c b/utf8.c
index a926735..992629d 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -2051,7 +2051,7 @@ S_swash_get(pTHX_ SV* swash, UV start, UV span)
                }
 
                if (opc == '+' && otherval)
                }
 
                if (opc == '+' && otherval)
-                   ; /* replace with otherval */
+                   /*EMPTY*/;   /* replace with otherval */
                else if (opc == '!' && !otherval)
                    otherval = 1;
                else if (opc == '-' && otherval)
                else if (opc == '!' && !otherval)
                    otherval = 1;
                else if (opc == '-' && otherval)