Change 34597 by [EMAIL PROTECTED] on 2008/10/26 19:05:49
Integrate:
[ 34592]
Integrate:
[ 34575]
Make C++ compilers happy #2: const POD without initializer
is an error for g++, even when static.
[ 34579]
Make C++ compilers happy #5: jump to 'do_write' crossed
initialization in dTHX.
Plus some consting, which also makes C++ happier.
Affected files ...
... //depot/maint-5.8/perl/malloc.c#28 integrate
... //depot/maint-5.8/perl/perl.c#235 integrate
Differences ...
==== //depot/maint-5.8/perl/malloc.c#28 (text) ====
Index: perl/malloc.c
--- perl/malloc.c#27~34279~ 2008-09-05 12:03:34.000000000 -0700
+++ perl/malloc.c 2008-10-26 12:05:49.000000000 -0700
@@ -970,7 +970,7 @@
static void morecore (register int bucket);
# if defined(DEBUGGING)
-static void botch (char *diag, char *s, char *file, int line);
+static void botch (const char *diag, const char *s, const char
*file, int line);
# endif
static void add_to_chain (void *p, MEM_SIZE size, MEM_SIZE chip);
static void* get_from_chain (MEM_SIZE size);
@@ -1281,7 +1281,7 @@
#endif /* defined PERL_EMERGENCY_SBRK */
static void
-write2(char *mess)
+write2(const char *mess)
{
write(2, mess, strlen(mess));
}
@@ -1291,12 +1291,12 @@
#define ASSERT(p,diag) if (!(p))
botch(diag,STRINGIFY(p),__FILE__,__LINE__);
static void
-botch(char *diag, char *s, char *file, int line)
+botch(const char *diag, const char *s, const char *file, int line)
{
+ dTHX;
if (!(PERL_MAYBE_ALIVE && PERL_GET_THX))
goto do_write;
else {
- dTHX;
if (PerlIO_printf(PerlIO_stderr(),
"assertion botched (%s?): %s %s:%d\n",
diag, s, file, line) != 0) {
==== //depot/maint-5.8/perl/perl.c#235 (text) ====
Index: perl/perl.c
--- perl/perl.c#234~34539~ 2008-10-20 12:55:16.000000000 -0700
+++ perl/perl.c 2008-10-26 12:05:49.000000000 -0700
@@ -716,7 +716,7 @@
int f;
const char *where;
/* Our success message is an integer 0, and a char 0 */
- static const char success[sizeof(int) + 1];
+ static const char success[sizeof(int) + 1] = {0};
close(fd[0]);
End of Patch.