Change 29999 by [EMAIL PROTECTED] on 2007/01/26 11:02:10
Integrate:
[ 28327]
Silence a warning
[ 28413]
Subject: [PATCH] <toke.c> isALNUM(*s) && *s != '_'
From: "Dr.Ruud" <[EMAIL PROTECTED]>
Date: Wed, 21 Jun 2006 01:58:19 +0200
Message-ID: <[EMAIL PROTECTED]>
[ 28447]
Some CPP macro sanitization by Sadahiro Tomoyuki
[ 28453]
HASATTRIBUTE_UNUSED works for gcc-3.3, but not for g++-3.3
Subject: Re: [PATCH] Re: [perl #39634] gcc 3.3 has problems with
__attribute__((unused))
From: Andrew Dougherty <[EMAIL PROTECTED]>
Date: Thu, 29 Jun 2006 13:41:28 -0400 (EDT)
Message-ID: <[EMAIL PROTECTED]>
[ 28456]
Fix a couple of compilation warnings
[ 28457]
PERL_UNUSED_CONTEXT is not enough to silence warnings when pTHXx
is used.
[ 28459]
Fix casting warnings related to snprintf/vsnprintf
[ 28465]
remove some unnecessary uses of WITH_THR
[ 28476]
Subject: [PATCH] toke.c consting and localizing
From: [EMAIL PROTECTED] (Andy Lester)
Date: Mon, 3 Jul 2006 17:42:50 -0500
Message-ID: <[EMAIL PROTECTED]>
Affected files ...
... //depot/maint-5.8/perl/mg.c#136 integrate
... //depot/maint-5.8/perl/op.c#184 integrate
... //depot/maint-5.8/perl/perl.c#194 integrate
... //depot/maint-5.8/perl/perl.h#139 integrate
... //depot/maint-5.8/perl/regcomp.c#92 integrate
... //depot/maint-5.8/perl/toke.c#152 integrate
... //depot/maint-5.8/perl/utfebcdic.h#8 integrate
... //depot/maint-5.8/perl/util.c#132 integrate
Differences ...
==== //depot/maint-5.8/perl/mg.c#136 (text) ====
Index: perl/mg.c
--- perl/mg.c#135~29974~ 2007-01-25 09:04:16.000000000 -0800
+++ perl/mg.c 2007-01-26 03:02:10.000000000 -0800
@@ -963,7 +963,7 @@
case '/':
break;
case '[':
- WITH_THR(sv_setiv(sv, (IV)CopARYBASE_get(PL_curcop)));
+ sv_setiv(sv, (IV)CopARYBASE_get(PL_curcop));
break;
case '|':
if (GvIOp(PL_defoutgv))
==== //depot/maint-5.8/perl/op.c#184 (text) ====
Index: perl/op.c
--- perl/op.c#183~29997~ 2007-01-26 02:30:23.000000000 -0800
+++ perl/op.c 2007-01-26 03:02:10.000000000 -0800
@@ -660,7 +660,7 @@
else
scalar(kid);
}
- WITH_THR(PL_curcop = &PL_compiling);
+ PL_curcop = &PL_compiling;
break;
case OP_SCOPE:
case OP_LINESEQ:
@@ -671,7 +671,7 @@
else
scalar(kid);
}
- WITH_THR(PL_curcop = &PL_compiling);
+ PL_curcop = &PL_compiling;
break;
case OP_SORT:
if (ckWARN(WARN_VOID))
@@ -977,7 +977,7 @@
else
list(kid);
}
- WITH_THR(PL_curcop = &PL_compiling);
+ PL_curcop = &PL_compiling;
break;
case OP_SCOPE:
case OP_LINESEQ:
@@ -987,7 +987,7 @@
else
list(kid);
}
- WITH_THR(PL_curcop = &PL_compiling);
+ PL_curcop = &PL_compiling;
break;
case OP_REQUIRE:
/* all requires must return a boolean value */
==== //depot/maint-5.8/perl/perl.c#194 (text) ====
Index: perl/perl.c
--- perl/perl.c#193~29964~ 2007-01-24 15:53:28.000000000 -0800
+++ perl/perl.c 2007-01-26 03:02:10.000000000 -0800
@@ -250,7 +250,7 @@
#endif /* FAKE_THREADS */
#endif /* USE_5005THREADS */
- PERL_UNUSED_CONTEXT;
+ PERL_UNUSED_ARG(my_perl);
#ifdef MULTIPLICITY
init_interp();
PL_perl_destruct_level = 1;
@@ -556,7 +556,7 @@
dTHX;
#endif /* USE_5005THREADS */
- PERL_UNUSED_CONTEXT;
+ PERL_UNUSED_ARG(my_perl);
/* wait for all pseudo-forked children to finish */
PERL_WAIT_FOR_CHILDREN;
@@ -1530,7 +1530,7 @@
dTHX;
#endif
- PERL_UNUSED_VAR(my_perl);
+ PERL_UNUSED_ARG(my_perl);
#ifdef SETUID_SCRIPTS_ARE_SECURE_NOW
#ifdef IAMSUID
@@ -2369,7 +2369,7 @@
dTHX;
#endif
- PERL_UNUSED_CONTEXT;
+ PERL_UNUSED_ARG(my_perl);
oldscope = PL_scopestack_ix;
#ifdef VMS
==== //depot/maint-5.8/perl/perl.h#139 (text) ====
Index: perl/perl.h
--- perl/perl.h#138~29984~ 2007-01-25 14:41:11.000000000 -0800
+++ perl/perl.h 2007-01-26 03:02:10.000000000 -0800
@@ -1405,7 +1405,7 @@
#if defined(HAS_SNPRINTF) && defined(HAS_C99_VARIADIC_MACROS) &&
!(defined(DEBUGGING) && !defined(PERL_USE_GCC_BRACE_GROUPS))
# ifdef PERL_USE_GCC_BRACE_GROUPS
-# define my_snprintf(buffer, len, ...) ({ int __len__ = snprintf(buffer,
len, __VA_ARGS__); if ((len) > 0 && __len__ >= (len)) Perl_croak(aTHX_ "panic:
snprintf buffer overflow"); __len__; })
+# define my_snprintf(buffer, len, ...) ({ int __len__ = snprintf(buffer,
len, __VA_ARGS__); if ((len) > 0 && (Size_t)__len__ >= (len)) Perl_croak(aTHX_
"panic: snprintf buffer overflow"); __len__; })
# define PERL_MY_SNPRINTF_GUARDED
# else
# define my_snprintf(buffer, len, ...) snprintf(buffer, len, __VA_ARGS__)
@@ -1417,7 +1417,7 @@
#if defined(HAS_VSNPRINTF) && defined(HAS_C99_VARIADIC_MACROS) &&
!(defined(DEBUGGING) && !defined(PERL_USE_GCC_BRACE_GROUPS))
# ifdef PERL_USE_GCC_BRACE_GROUPS
-# define my_vsnprintf(buffer, len, ...) ({ int __len__ =
vsnprintf(buffer, len, __VA_ARGS__); if ((len) > 0 && __len__ >= (len))
Perl_croak(aTHX_ "panic: vsnprintf buffer overflow"); __len__; })
+# define my_vsnprintf(buffer, len, ...) ({ int __len__ =
vsnprintf(buffer, len, __VA_ARGS__); if ((len) > 0 && (Size_t)__len__ >= (len))
Perl_croak(aTHX_ "panic: vsnprintf buffer overflow"); __len__; })
# define PERL_MY_VSNPRINTF_GUARDED
# else
# define my_vsnprintf(buffer, len, ...) vsnprintf(buffer, len, __VA_ARGS__)
@@ -2499,6 +2499,9 @@
* http://www.ohse.de/uwe/articles/gcc-attributes.html,
* but contrary to this information warn_unused_result seems
* not to be in gcc 3.3.5, at least. --jhi
+ * Also, when building extensions with an installed perl, this allows
+ * the user to upgrade gcc and get the right attributes, rather than
+ * relying on the list generated at Configure time. --AD
* Set these up now otherwise we get confused when some of the <*thread.h>
* includes below indirectly pull in <perlio.h> (which needs to know if we
* have HASATTRIBUTE_FORMAT).
@@ -2520,7 +2523,8 @@
# if __GNUC__ >= 3 /* gcc 3.0 -> */
# define HASATTRIBUTE_PURE
# endif
-# if __GNUC__ >= 3 /* gcc 3.0 -> */ /* XXX Verify this version */
+# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */
+ /* This actually works for gcc-3.3, but not for g++-3.3. */
# define HASATTRIBUTE_UNUSED
# endif
# if __GNUC__ == 3 && __GNUC_MINOR__ >= 4 || __GNUC__ > 3 /* 3.4 -> */
==== //depot/maint-5.8/perl/regcomp.c#92 (text) ====
Index: perl/regcomp.c
--- perl/regcomp.c#91~29984~ 2007-01-25 14:41:11.000000000 -0800
+++ perl/regcomp.c 2007-01-26 03:02:10.000000000 -0800
@@ -3553,7 +3553,7 @@
STATIC regnode *
S_regclass(pTHX_ RExC_state_t *pRExC_state)
{
- register UV value;
+ register UV value = 0;
register UV nextvalue;
register IV prevvalue = OOB_UNICODE;
register IV range = 0;
==== //depot/maint-5.8/perl/toke.c#152 (text) ====
Index: perl/toke.c
--- perl/toke.c#151~29996~ 2007-01-26 01:54:13.000000000 -0800
+++ perl/toke.c 2007-01-26 03:02:10.000000000 -0800
@@ -1626,8 +1626,7 @@
/* FALL THROUGH */
default:
{
- if (isALNUM(*s) &&
- *s != '_' &&
+ if ((isALPHA(*s) || isDIGIT(*s)) &&
ckWARN(WARN_MISC))
Perl_warner(aTHX_ packWARN(WARN_MISC),
"Unrecognized escape \\%c passed through",
@@ -5623,7 +5622,7 @@
S_pending_ident(pTHX)
{
register char *d;
- register I32 tmp = 0;
+ PADOFFSET tmp = 0;
/* pit holds the identifier we read and pending_ident is reset */
char pit = PL_pending_ident;
PL_pending_ident = 0;
@@ -9871,12 +9870,11 @@
filehandle
*/
if (*d == '$') {
- I32 tmp;
-
/* try to find it in the pad for this block, otherwise find
add symbol table ops
*/
- if ((tmp = pad_findmy(d)) != NOT_IN_PAD) {
+ const PADOFFSET tmp = pad_findmy(d);
+ if (tmp != NOT_IN_PAD) {
if (PAD_COMPNAME_FLAGS_isOUR(tmp)) {
SV * const sym = sv_2mortal(
newSVpv(HvNAME_get(PAD_COMPNAME_OURSTASH(tmp)),0));
==== //depot/maint-5.8/perl/utfebcdic.h#8 (text) ====
Index: perl/utfebcdic.h
--- perl/utfebcdic.h#7~29770~ 2007-01-12 04:22:53.000000000 -0800
+++ perl/utfebcdic.h 2007-01-26 03:02:10.000000000 -0800
@@ -337,7 +337,7 @@
END_EXTERN_C
-#define UTF8SKIP(s) PL_utf8skip[*(const U8*)s]
+#define UTF8SKIP(s) PL_utf8skip[*(const U8*)(s)]
/* EBCDIC-happy ways of converting native code to UTF-8 */
==== //depot/maint-5.8/perl/util.c#132 (text) ====
Index: perl/util.c
--- perl/util.c#131~29993~ 2007-01-26 01:15:17.000000000 -0800
+++ perl/util.c 2007-01-26 03:02:10.000000000 -0800
@@ -4967,7 +4967,7 @@
#endif
va_end(ap);
/* vsnprintf() shows failure with >= len, vsprintf() with < 0 */
- if (retval < 0 || (len > 0 && retval >= len))
+ if (retval < 0 || (len > 0 && (Size_t)retval >= len))
Perl_croak(aTHX_ "panic: my_snprintf buffer overflow");
return retval;
}
@@ -5004,7 +5004,7 @@
# endif
#endif /* #ifdef NEED_VA_COPY */
/* vsnprintf() shows failure with >= len, vsprintf() with < 0 */
- if (retval < 0 || (len > 0 && retval >= len))
+ if (retval < 0 || (len > 0 && (Size_t)retval >= len))
Perl_croak(aTHX_ "panic: my_vsnprintf buffer overflow");
return retval;
}
End of Patch.