Discussion:
[perl #44845] [PATCH] C++ cleanups for Solaris CC
(too old to reply)
Steve Peters
2007-08-22 14:19:26 UTC
Permalink
--- src/encoding.c.old Wed Aug 22 08:15:22 2007
+++ src/encoding.c Wed Aug 22 08:15:58 2007
@@ -105,6 +105,7 @@
{
UNUSED(encodingname);
real_exception(interp, NULL, UNIMPLEMENTED, "Can't load encodings yet");
+ return NULL;
}
/*
--- src/interpreter.c.old Wed Aug 22 08:16:48 2007
+++ src/interpreter.c Wed Aug 22 08:17:39 2007
@@ -692,6 +692,7 @@
PIO_eprintf(interp,
"Computed goto unavailable in this configuration.\n");
Parrot_exit(interp, 1);
+ return pc;
#endif
}
I don't know if these two changes bring anything. Neither function
actually returns even though there is a return value expected, so the
added code is actually dead code as it will never get executed. The
function real_exception() doesn't return, and we should be able to
tell the compiler that (this is what Andy Lester has been doing a lot
of with his recent function attribute work). I'm guessing that suncc
throws a warning here can be rectified in the fullness of time.
Just my $0.02
Paul
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.

Steve Peters
***@fisharerojo.org
Paul Cochrane
2007-08-22 14:11:38 UTC
Permalink
--- src/encoding.c.old Wed Aug 22 08:15:22 2007
+++ src/encoding.c Wed Aug 22 08:15:58 2007
@@ -105,6 +105,7 @@
{
UNUSED(encodingname);
real_exception(interp, NULL, UNIMPLEMENTED, "Can't load encodings yet");
+ return NULL;
}
/*
--- src/interpreter.c.old Wed Aug 22 08:16:48 2007
+++ src/interpreter.c Wed Aug 22 08:17:39 2007
@@ -692,6 +692,7 @@
PIO_eprintf(interp,
"Computed goto unavailable in this configuration.\n");
Parrot_exit(interp, 1);
+ return pc;
#endif
}
I don't know if these two changes bring anything. Neither function
actually returns even though there is a return value expected, so the
added code is actually dead code as it will never get executed. The
function real_exception() doesn't return, and we should be able to
tell the compiler that (this is what Andy Lester has been doing a lot
of with his recent function attribute work). I'm guessing that suncc
throws a warning here can be rectified in the fullness of time.

Just my $0.02

Paul
Steve Peters
2007-08-22 14:02:38 UTC
Permalink
# New Ticket Created by Steve Peters
# Please include the string: [perl #44845]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=44845 >


Solaris CC is a bit more sensative than g++ in three cases. First, making
sure that arguments have the correct type. Second, making sure that that
return type is correct. Finally, functions that return something, must
return. The attached patch fixes these things.

Steve Peters
***@fishareorjo.org
Jerry Gay
2007-08-22 14:40:37 UTC
Permalink
Post by Steve Peters
--- src/encoding.c.old Wed Aug 22 08:15:22 2007
+++ src/encoding.c Wed Aug 22 08:15:58 2007
@@ -105,6 +105,7 @@
{
UNUSED(encodingname);
real_exception(interp, NULL, UNIMPLEMENTED, "Can't load encodings yet");
+ return NULL;
}
/*
--- src/interpreter.c.old Wed Aug 22 08:16:48 2007
+++ src/interpreter.c Wed Aug 22 08:17:39 2007
@@ -692,6 +692,7 @@
PIO_eprintf(interp,
"Computed goto unavailable in this configuration.\n");
Parrot_exit(interp, 1);
+ return pc;
#endif
}
I don't know if these two changes bring anything. Neither function
actually returns even though there is a return value expected, so the
added code is actually dead code as it will never get executed. The
function real_exception() doesn't return, and we should be able to
tell the compiler that (this is what Andy Lester has been doing a lot
of with his recent function attribute work). I'm guessing that suncc
throws a warning here can be rectified in the fullness of time.
Just my $0.02
Paul
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.
these are compile *errors*? wow. they'll cause 'unreachable code'
warnings on msvc, but that's for the greater good if it allows solaris
cc to build parrot. however, please put a note somewhere or mark these
so that they're not removed by somebody who later decides to remove
unreachable code.

~jerry
Paul Cochrane
2007-08-22 15:06:14 UTC
Permalink
Post by Steve Peters
--- src/encoding.c.old Wed Aug 22 08:15:22 2007
+++ src/encoding.c Wed Aug 22 08:15:58 2007
@@ -105,6 +105,7 @@
{
UNUSED(encodingname);
real_exception(interp, NULL, UNIMPLEMENTED, "Can't load encodings yet");
+ return NULL;
}
/*
--- src/interpreter.c.old Wed Aug 22 08:16:48 2007
+++ src/interpreter.c Wed Aug 22 08:17:39 2007
@@ -692,6 +692,7 @@
PIO_eprintf(interp,
"Computed goto unavailable in this configuration.\n");
Parrot_exit(interp, 1);
+ return pc;
#endif
}
I don't know if these two changes bring anything. Neither function
actually returns even though there is a return value expected, so the
added code is actually dead code as it will never get executed. The
function real_exception() doesn't return, and we should be able to
tell the compiler that (this is what Andy Lester has been doing a lot
of with his recent function attribute work). I'm guessing that suncc
throws a warning here can be rectified in the fullness of time.
Just my $0.02
Paul
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.
That's weird as I had suncc compiling Parrot recently...
Paul Cochrane
2007-08-22 15:40:45 UTC
Permalink
Post by Steve Peters
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.
I just tried to compile Parrot with suncc and everything works (the
tests are running atm). Did you configure with --cgoto=0? This is a
known problem that suncc should be able to handle computed gotos but
switching them off actually makes suncc build Parrot and allows the
tests to run.

Paul
Paul Cochrane
2007-08-22 17:26:04 UTC
Permalink
Post by Paul Cochrane
Post by Steve Peters
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.
I just tried to compile Parrot with suncc and everything works (the
CC isn't cc
(C++ compiler versus C compiler)
Ooops. Didn't realise, sorry.
Nicholas Clark
2007-08-22 17:14:34 UTC
Permalink
Post by Paul Cochrane
Post by Steve Peters
We can leave it out, but then we'll never be able to compile Parrot with
Solaris CC.
I just tried to compile Parrot with suncc and everything works (the
CC isn't cc


(C++ compiler versus C compiler)

Nicholas Clark
James Keenan via RT
2008-03-16 18:10:17 UTC
Permalink
Cage cleaning question: Can we get an update on the status of the patch
proposed in this ticket?

Thank you very much.
kid51
NotFound
2008-12-16 08:33:30 UTC
Permalink
I just tried to build parrot with g++ on darwin/intel to see if I could replicate the initial failure
reported in the ticket, but am unable to. (g++ is detected as gcc, and then we pass it an option
that makes it explode.)
What Configure options do you used? I usually do:

--cc=g++ --cxx=g++ --ld=g++ --link=g++
--
Salu2
Andrew Dougherty
2009-04-17 12:39:33 UTC
Permalink
Closing this ticket, the patch is very outdated and nobody is reporting
related problems. If someone found any problem with the Solaris C++
compiler, or any other, please crate a new ticket in parrot trac.
The files may have moved so that the patch no longer applies, but the
issues raised are still present. Nobody is reporting related problems
because nobody is reporting builds with the Solaris C++ compiler. (It's
not the default configuration.)
--
Andy Dougherty ***@lafayette.edu
Loading...