[m-dev.] Q: Declare_static?

Peter Ross petdr at cs.mu.OZ.AU
Tue Nov 23 10:59:23 AEDT 1999


In the following code, compiled in the grade none.gc

==================================
Declare_static(mercury__exception__call_io_pred_4_0);

void
ML_exception_call_io_pred_det(Word Mercury__argument1, Word
Mercury__argument2, Word * Mercury__argument3)
{   
#if NUM_REAL_REGS > 0
    Word c_regs[NUM_REAL_REGS];
#endif

    save_regs_to_mem(c_regs);
    restore_registers();
    r1 = Mercury__argument1;
    r2 = Mercury__argument2;
    save_transient_registers();
    {
    Declare_static(mercury__exception__call_io_pred_4_0);
    (void) MR_call_engine(ENTRY(mercury__exception__call_io_pred_4_0), FALSE);
    }
    restore_transient_registers();
    *Mercury__argument3 = r1;
    restore_regs_from_mem(c_regs);
}
==================================

the label mercury__exception__call_io_pred_4_0 is declared static twice,
the second one results in the lcc compiler giving the following error
message

exception.c:4152: invalid storage class `static' for `pointer to void
function(void) mercury__exception__call_io_pred_4_0'

There is two fixes that work, but are they correct?
    * don't generate the second Declare_static
    * or make it a Define_extern_entry

Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list