Ticket #652 (closed bug: fixed)

Opened 13 years ago

Last modified 12 years ago

non-constant initializations in src/pmc/*.c

Reported by: doughera Owned by:
Priority: normal Milestone:
Component: none Version: 1.1.0
Severity: low Keywords:
Cc: Language:
Patch status: applied Platform:

Description

As of r38606, the C files generated in src/pmc/ contain code like the following (this snippet comes from src/pmc/sub.c):

        STRING *mfl_0 = CONST_STRING_GEN(interp, "is_equal");
        STRING *mfl_1 = CONST_STRING_GEN(interp, "IJPP");
        STRING *mfl_2 = CONST_STRING_GEN(interp, "Sub,PMC");

    const  multi_func_list _temp_multi_func_list[] = {
                { mfl_0,
          mfl_1,
          mfl_2,
          (funcptr_t) Parrot_Sub_multi_is_equal_PMC }

    };

Unfortunately, that's not going to work with older C89 compilers. The initializers must truly be constants.

Since this is generated code, I'm not sure just what to patch, nor whether it's worth it.

Change History

  Changed 13 years ago by doughera

I'm not sure what to do with this ticket. It's "fatal" for me, but probably doesn't directly affect anyone else at the moment. Unfortunately, the compiler in question (an older Sun CC on Solaris/SPARC) is my main parrot development machine. Since it's a non-gcc, non-i386 system, it's been helpful in detecting endian and alignment issues, as well as issues specific to the gcc toolchain.

I fully understand and accept that the primary responsibility for making it to work on my system is mine, but I don't realistically expect to have time to do anything about it any time soon. I wouldn't object if anyone else wanted to jump in and fix it.

  Changed 12 years ago by NotFound

The multi_func_list usage is temporary, don't need to be const, and consting it gives no benefit. Unconsted in r45986. Please let us know if that fixes the problem.

  Changed 12 years ago by doughera

On Sat, 24 Apr 2010, Parrot wrote:

>  The multi_func_list usage is temporary, don't need to be const, and
>  consting it gives no benefit. Unconsted in r45986. Please let us know if
>  that fixes the problem.

Thanks, but I'm afraid that's not the problem at all.  It's the 
initializers (i.e. mfl_0, mfl_1, etc.) that need to be compile-time 
constants.  

-- 
    Andy Dougherty		doughera@lafayette.edu

follow-up: ↓ 5   Changed 12 years ago by NotFound

Changed initialization to assignments in r46003

in reply to: ↑ 4   Changed 12 years ago by doughera

  • status changed from new to closed
  • resolution set to fixed
  • patch set to applied

Replying to NotFound:

Changed initialization to assignments in r46003

Thank you. That compiles now. (I still have other problems in the build, but at least this one is fixed!) I'll close the ticket.

Thanks!

Note: See TracTickets for help on using tickets.