# New Ticket Created by Andy Dougherty
# Please include the string: [perl #60616]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=60616 >
The latest version of Sun's compiler,
cc: Sun Ceres C 5.10 SunOS_i386 2008/10/22
needs the following patch to compile parrot. The problem appears to be
the same one already documented for icc in tools/build/c2str.pl:
# NOTE: when CONST_STRING gets used it and any macro invocations
# that it is used in *should not* be split across more than one
# line, because some compilers generate line numbers in such cases
# differently from the way gcc does this (a case in point is
# Intel's C compiler, icc) and hence the #defined CONST_STRING
# won't be found by the compiler.
This patch re-joins CONST_STRING invocations that have been split across
more than one line. This will undoubtedly fall afoul of some coding
standard test, but I think compiling trumps passing a line-length test.
Ultimately, it might be nice if there weren't this arbitrary restriction,
but I'd have to dig much deeper before I understood the whole process
well enough to propose a better solution.
diff -r -u parrot-current/src/exceptions.c parrot-suncc/src/exceptions.c
--- parrot-current/src/exceptions.c 2008-11-05 11:15:17.000000000 -0500
+++ parrot-suncc/src/exceptions.c 2008-11-17 14:22:33.000000000 -0500
@@ -71,10 +71,8 @@
{
PMC *exception = pmc_new(interp, enum_class_Exception);
- VTABLE_set_integer_keyed_str(interp, exception,
- CONST_STRING(interp, "severity"), severity);
- VTABLE_set_integer_keyed_str(interp, exception,
- CONST_STRING(interp, "type"), error);
+ VTABLE_set_integer_keyed_str(interp, exception, CONST_STRING(interp,
"severity"), severity);
+ VTABLE_set_integer_keyed_str(interp, exception, CONST_STRING(interp,
"type"), error);
if (msg)
VTABLE_set_string_native(interp, exception, msg);
@@ -103,8 +101,7 @@
else {
STRING * const message = VTABLE_get_string(interp, exception);
INTVAL exit_status = 1;
- const INTVAL severity = VTABLE_get_integer_keyed_str(interp,
- exception, CONST_STRING(interp, "severity"));
+ const INTVAL severity = VTABLE_get_integer_keyed_str(interp,
exception, CONST_STRING(interp, "severity"));
/* flush interpreter output to get things printed in order */
PIO_flush(interp, PIO_STDOUT(interp));
@@ -122,8 +119,7 @@
}
else if (severity == EXCEPT_exit) {
/* TODO: get exit status based on type */
- exit_status = VTABLE_get_integer_keyed_str(interp,
- exception, CONST_STRING(interp, "exit_code"));
+ exit_status = VTABLE_get_integer_keyed_str(interp, exception,
CONST_STRING(interp, "exit_code"));
}
else {
PIO_eprintf(interp, "No exception handler and no message\n");
@@ -284,8 +280,7 @@
}
if (Interp_debug_TEST(interp, PARROT_BACKTRACE_DEBUG_FLAG)) {
- int exitcode = VTABLE_get_integer_keyed_str(interp, exception,
- CONST_STRING(interp, "exit_code"));
+ int exitcode = VTABLE_get_integer_keyed_str(interp, exception,
CONST_STRING(interp, "exit_code"));
STRING *msg = VTABLE_get_string(interp, exception);
PIO_eprintf(interp,
"Parrot_ex_throw_from_c (severity:%d error:%d): %Ss\n",
@@ -430,8 +425,7 @@
void
Parrot_ex_mark_unhandled(PARROT_INTERP, ARGIN(PMC *exception))
{
- VTABLE_set_integer_keyed_str(interp, exception,
- CONST_STRING(interp, "handled"), -1);
+ VTABLE_set_integer_keyed_str(interp, exception, CONST_STRING(interp,
"handled"), -1);
}
/*
diff -r -u parrot-current/src/inter_call.c parrot-suncc/src/inter_call.c
--- parrot-current/src/inter_call.c 2008-10-23 19:15:10.000000000 -0400
+++ parrot-suncc/src/inter_call.c 2008-11-17 14:22:57.000000000 -0500
@@ -2610,8 +2610,7 @@
PMC * const args_sig = pmc_new(interp, enum_class_FixedIntegerArray);
PMC * const results_sig = pmc_new(interp, enum_class_FixedIntegerArray);
PMC * const ret_cont = new_ret_continuation_pmc(interp, NULL);
- PMC * const result_list = VTABLE_get_attr_str(interp, sig_obj,
- CONST_STRING(interp, "returns"));
+ PMC * const result_list = VTABLE_get_attr_str(interp, sig_obj,
CONST_STRING(interp, "returns"));
Parrot_Context *ctx;
opcode_t *dest;
diff -r -u parrot-current/src/multidispatch.c parrot-suncc/src/multidispatch.c
--- parrot-current/src/multidispatch.c 2008-11-05 03:15:14.000000000 -0500
+++ parrot-suncc/src/multidispatch.c 2008-11-17 14:23:33.000000000 -0500
@@ -435,8 +435,7 @@
/* Only create the returns array if it's needed */
if (in_return_sig && PMC_IS_NULL(returns)) {
returns = pmc_new(interp, enum_class_ResizablePMCArray);
- VTABLE_set_attr_str(interp, call_object,
- CONST_STRING(interp, "results"), returns);
+ VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp,
"results"), returns);
}
if (in_return_sig) {
@@ -449,23 +448,19 @@
switch (type) {
case 'I':
VTABLE_set_pointer(interp, val_pointer, (void *)
va_arg(args, INTVAL*));
- VTABLE_set_string_keyed_str(interp, val_pointer,
- signature, CONST_STRING(interp, "I"));
+ VTABLE_set_string_keyed_str(interp, val_pointer,
signature, CONST_STRING(interp, "I"));
break;
case 'N':
VTABLE_set_pointer(interp, val_pointer, (void *)
va_arg(args, FLOATVAL*));
- VTABLE_set_string_keyed_str(interp, val_pointer,
- signature, CONST_STRING(interp, "N"));
+ VTABLE_set_string_keyed_str(interp, val_pointer,
signature, CONST_STRING(interp, "N"));
break;
case 'S':
VTABLE_set_pointer(interp, val_pointer, (void *)
va_arg(args, STRING**));
- VTABLE_set_string_keyed_str(interp, val_pointer,
- signature, CONST_STRING(interp, "S"));
+ VTABLE_set_string_keyed_str(interp, val_pointer,
signature, CONST_STRING(interp, "S"));
break;
case 'P':
VTABLE_set_pointer(interp, val_pointer, (void *)
va_arg(args, PMC**));
- VTABLE_set_string_keyed_str(interp, val_pointer,
- signature, CONST_STRING(interp, "P"));
+ VTABLE_set_string_keyed_str(interp, val_pointer,
signature, CONST_STRING(interp, "P"));
break;
default:
Parrot_ex_throw_from_c_args(interp, NULL,
diff -r -u parrot-current/src/pmc/exceptionhandler.pmc
parrot-suncc/src/pmc/exceptionhandler.pmc
--- parrot-current/src/pmc/exceptionhandler.pmc 2008-11-17 03:15:13.000000000
-0500
+++ parrot-suncc/src/pmc/exceptionhandler.pmc 2008-11-17 14:24:36.000000000
-0500
@@ -204,8 +204,7 @@
}
else if (core_struct->handled_types != PMCNULL) {
INTVAL elems = VTABLE_elements(interp,
core_struct->handled_types);
- INTVAL type = VTABLE_get_integer_keyed_str(interp, exception,
- CONST_STRING(interp, "type"));
+ INTVAL type = VTABLE_get_integer_keyed_str(interp, exception,
CONST_STRING(interp, "type"));
INTVAL i;
for (i = 0; i < elems; i++) {
diff -r -u parrot-current/src/pmc/scheduler.pmc
parrot-suncc/src/pmc/scheduler.pmc
--- parrot-current/src/pmc/scheduler.pmc 2008-09-08 19:15:13.000000000
-0400
+++ parrot-suncc/src/pmc/scheduler.pmc 2008-11-17 14:25:11.000000000 -0500
@@ -464,10 +464,8 @@
/* Exceptions store the handler iterator for rethrow, other kinds of
* tasks don't (though they could). */
if (task->vtable->base_type == enum_class_Exception
- && VTABLE_get_integer_keyed_str(interp, task,
- CONST_STRING(interp, "handled")) == -1) {
- iter = VTABLE_get_attr_str(interp, task,
- CONST_STRING(interp, "handler_iter"));
+ && VTABLE_get_integer_keyed_str(interp, task, CONST_STRING(interp,
"handled")) == -1) {
+ iter = VTABLE_get_attr_str(interp, task, CONST_STRING(interp,
"handler_iter"));
}
else {
PMC *handlers;
@@ -475,8 +473,7 @@
iter = VTABLE_get_iter(interp, handlers);
if (task->vtable->base_type == enum_class_Exception)
- VTABLE_set_attr_str(interp, task,
- CONST_STRING(interp, "handler_iter"), iter);
+ VTABLE_set_attr_str(interp, task, CONST_STRING(interp,
"handler_iter"), iter);
}
/* Loop from newest handler to oldest handler. */
diff -r -u parrot-current/src/scheduler.c parrot-suncc/src/scheduler.c
--- parrot-current/src/scheduler.c 2008-11-17 03:15:14.000000000 -0500
+++ parrot-suncc/src/scheduler.c 2008-11-17 14:24:09.000000000 -0500
@@ -745,10 +745,8 @@
/* Exceptions store the handler iterator for rethrow, other kinds of
* tasks don't (though they could). */
if (task->vtable->base_type == enum_class_Exception &&
- VTABLE_get_integer_keyed_str(interp, task,
- CONST_STRING(interp, "handled")) == -1) {
- iter = VTABLE_get_attr_str(interp, task,
- CONST_STRING(interp, "handler_iter"));
+ VTABLE_get_integer_keyed_str(interp, task, CONST_STRING(interp,
"handled")) == -1) {
+ iter = VTABLE_get_attr_str(interp, task, CONST_STRING(interp,
"handler_iter"));
context = (Parrot_Context *)VTABLE_get_pointer(interp, task);
}
else {
@@ -770,8 +768,7 @@
if (valid_handler) {
if (task->vtable->base_type == enum_class_Exception) {
/* Store iterator and context for a later rethrow. */
- VTABLE_set_attr_str(interp, task,
- CONST_STRING(interp, "handler_iter"), iter);
+ VTABLE_set_attr_str(interp, task, CONST_STRING(interp,
"handler_iter"), iter);
VTABLE_set_pointer(interp, task, context);
/* Mark that this handler has been used before. */
--
Andy Dougherty [EMAIL PROTECTED]