The patch attached eliminates a warning we're getting during 'make' when building with g++.

See https://en.wikibooks.org/wiki/GCC_Debugging/g%2B%2B/Warnings/deprecated_conversion_from_string_constant for more discussion of this warning.

I get 'make test PASS' with this patch on linux/i386 with all-gcc build and with the last commit at which 'make test PASS' was the result on all-g++ build. (All g++-build broken at the moment; see https://github.com/parrot/parrot/issues/840.)

Please evaluate the patch.

Thank you very much.
Jim Keenan
>From df48d5555321741ac0a5af2d0e0e477d8df446d3 Mon Sep 17 00:00:00 2001
From: jkeenan <[email protected]>
Date: Sat, 22 Sep 2012 20:59:48 -0400
Subject: [PATCH] Eliminate a warning appearing in g++ builds.

In g++ builds, we were getting this warning:

src/platform/generic/cpu_type.c: In function 'STRING* Parrot_get_cpu_type(parrot_interp_t*)':
src/platform/generic/cpu_type.c:48: warning: deprecated conversion from string constant to 'char*'

Not initializing with empty string avoids warning and appears to do no harm.
---
 src/platform/generic/cpu_type.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/platform/generic/cpu_type.c b/src/platform/generic/cpu_type.c
index 5186100..65307c1 100644
--- a/src/platform/generic/cpu_type.c
+++ b/src/platform/generic/cpu_type.c
@@ -45,7 +45,7 @@ For win32, look in platform/win32/misc.c
 STRING *
 Parrot_get_cpu_type(Parrot_Interp interp) {
     struct utsname uname_info;
-    char  *proc_arch = "";
+    char  *proc_arch;
 
 #ifdef PARROT_HAS_HEADER_SYSUTSNAME
     uname(&uname_info);
-- 
1.5.6.5

_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to