# New Ticket Created by "Senaka Fernando" # Please include the string: [perl #52854] # in the subject line of all future correspondence about this issue. # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=52854 >
The build of Parrot fails with g++, which is a possible indication that it fails on other C++ compilers too. I have attached herewith patches to some issues. However, I still get this error once I start with the build. Compiling with: xx.c g++ -I./include -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHASATTRIBUTE_CONST -DHASATTRIBUTE_DEPRECATED -DHASATTRIBUTE_MALLOC -DHASATTRIBUTE_NONNULL -DHASATTRIBUTE_NORETURN -DHASATTRIBUTE_PURE -DHASATTRIBUTE_UNUSED -DHASATTRIBUTE_WARN_UNUSED_RESULT -falign-functions=16 -fvisibility=hidden -maccumulate-outgoing-args -W -Wall -Waggregate-return -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wdisabled-optimization -Wendif-labels -Wextra -Wformat -Wformat-extra-args -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimplicit -Wimport -Winit-self -Winline -Winvalid-pch -Wmissing-braces -Wmissing-field-initializers -Wno-missing-format-attribute -Wmissing-include-dirs -Wpacked -Wparentheses -Wpointer-arith -Wreturn-type -Wsequence-point -Wno-shadow -Wsign-compare -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wtrigraphs -Wundef -Wunknown-pragmas -Wno-unused -Wvariadic-macros -Wwrite-strings -DHAS_GETTEXT -g -DHAS_JIT -DI386 -DHAVE_COMPUTED_GOTO -fPIC -I. -o xx.o -c xx.c src/pmc/bigint.c /usr/include/libintl.h:83: error: expected unqualified-id before 'throw' /usr/include/libintl.h:83: error: expected initializer before 'throw' /usr/include/libintl.h:87: error: expected unqualified-id before 'throw' /usr/include/libintl.h:87: error: expected initializer before 'throw' make: *** [src/pmc/bigint.o] Error 1 This error didn't come up with a check out I took around two weeks back, but with the latest svn up it does. Wondering what this could be. Regards, Senaka
Index: src/pmc/role.pmc =================================================================== --- src/pmc/role.pmc (revision 26955) +++ src/pmc/role.pmc (working copy) @@ -432,7 +432,7 @@ PMC * const metadata = pmc_new(interp, enum_class_Hash); STRING * const name = CONST_STRING(interp, "name"); - STRING * const namespace = CONST_STRING(interp, "namespace"); + STRING * const _namespace = CONST_STRING(interp, "namespace"); STRING * const attributes = CONST_STRING(interp, "attributes"); STRING * const methods = CONST_STRING(interp, "methods"); STRING * const roles = CONST_STRING(interp, "roles"); @@ -440,8 +440,8 @@ VTABLE_set_pmc_keyed_str(interp, metadata, name, VTABLE_inspect_str(interp, SELF, name)); - VTABLE_set_pmc_keyed_str(interp, metadata, namespace, - VTABLE_inspect_str(interp, SELF, namespace)); + VTABLE_set_pmc_keyed_str(interp, metadata, _namespace, + VTABLE_inspect_str(interp, SELF, _namespace)); VTABLE_set_pmc_keyed_str(interp, metadata, attributes, VTABLE_inspect_str(interp, SELF, attributes)); Index: src/pmc/object.pmc =================================================================== --- src/pmc/object.pmc (revision 26955) +++ src/pmc/object.pmc (working copy) @@ -541,8 +541,8 @@ */ VTABLE INTVAL type() { - PMC *class = VTABLE_get_class(interp, SELF); - return VTABLE_type(interp, class); + PMC *_class = VTABLE_get_class(interp, SELF); + return VTABLE_type(interp, _class); } /* Index: src/pmc/sub.pmc =================================================================== --- src/pmc/sub.pmc (revision 26955) +++ src/pmc/sub.pmc (working copy) @@ -743,8 +743,8 @@ METHOD get_namespace() { Parrot_sub * const sub = PMC_sub(SELF); - PMC *namespace = sub->namespace_stash; - RETURN(PMC *namespace); + PMC *_namespace = sub->namespace_stash; + RETURN(PMC *_namespace); } METHOD __get_regs_used(STRING *reg) { Index: src/jit/i386/jit_emit.h =================================================================== --- src/jit/i386/jit_emit.h (revision 26955) +++ src/jit/i386/jit_emit.h (working copy) @@ -1722,7 +1722,7 @@ Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX); emitm_pushl_r(pc, emit_ECX); jit_info->native_ptr = pc; - call_func(jit_info, real_exception); + call_func(jit_info, (void *)real_exception); pc = jit_info->native_ptr; /* L1: */ L1[1] = (char)(pc - L1 - 2); @@ -1761,7 +1761,7 @@ Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX); emitm_pushl_r(pc, emit_ECX); jit_info->native_ptr = pc; - call_func(jit_info, real_exception); + call_func(jit_info, (void *)real_exception); pc = jit_info->native_ptr; /* L1: */ L1[1] = (char)(pc - L1 - 2); @@ -1955,7 +1955,7 @@ Parrot_jit_emit_get_INTERP(interp, pc, emit_ECX); emitm_pushl_r(pc, emit_ECX); jit_info->native_ptr = pc; - call_func(jit_info, real_exception); + call_func(jit_info, (void *)real_exception); pc = jit_info->native_ptr; /* L3: */ L3[1] = (char)(pc - L3 - 2); @@ -3603,7 +3603,7 @@ emitm_pushl_i(jit_info->native_ptr, CORE_OPS_check_events); call_func(jit_info, - (void (*)(void))interp->op_func_table[CORE_OPS_check_events]); + (void *)(interp->op_func_table[CORE_OPS_check_events])); # ifdef PARROT_JIT_STACK_REUSE_INTERP emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP); # else @@ -3625,7 +3625,7 @@ emitm_pushl_i(jit_info->native_ptr, jit_info->cur_op); call_func(jit_info, - (void (*)(void))interp->op_func_table[cur_op]); + (void *)(interp->op_func_table[cur_op])); # ifdef PARROT_JIT_STACK_REUSE_INTERP emitm_addb_i_r(jit_info->native_ptr, 4, emit_ESP); # else @@ -4013,7 +4013,7 @@ PARROT_ASSERT(pc - jit_info.arena.start <= size); /* could shrink arena.start here to used size */ PObj_active_destroy_SET(pmc_nci); - return (jit_f)D2FPTR(jit_info.arena.start); + return (void *)D2FPTR(jit_info.arena.start); } #endif Index: compilers/imcc/cfg.c =================================================================== --- compilers/imcc/cfg.c (revision 26955) +++ compilers/imcc/cfg.c (working copy) @@ -394,13 +394,15 @@ for (pred = bb->pred_list; pred; pred = pred->next) { int found = 0; if (STREQ(pred->from->end->opname, "bsr")) { - SymReg * const r = pred->from->end->symregs[0]; int j; + { + SymReg * const r = pred->from->end->symregs[0]; - sub = pred->to->start; - if ((sub->type & ITLABEL) && - STREQ(sub->symregs[0]->name, r->name)) - found = 1; + sub = pred->to->start; + if ((sub->type & ITLABEL) && + STREQ(sub->symregs[0]->name, r->name)) + found = 1; + } invok: j = pred->from->index; if (found) { Index: compilers/imcc/imclexer.c =================================================================== --- compilers/imcc/imclexer.c (revision 26955) +++ compilers/imcc/imclexer.c (working copy) @@ -4330,6 +4330,9 @@ yy_cp = yyg->yy_c_buf_p; yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; goto yy_find_action; + + default: + break; } break; } @@ -4440,7 +4443,7 @@ /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -4642,6 +4645,8 @@ case EOB_ACT_CONTINUE_SCAN: yyg->yy_c_buf_p = yyg->yytext_ptr + offset; break; + default: + break; } } }