[mercury-users] foreign_decl vs. foreign_code

Tyson Dowd trd at cs.mu.OZ.AU
Tue Feb 12 15:33:35 AEDT 2002


On 12-Feb-2002, Michael Day <mikeday at bigpond.net.au> wrote:
> 
> Hi,
> 
> I have a module which declares a global variable used by foreign_procs 
> later on. When compiling the module in asm_fast.gc grade, it doesn't 
> declare the variable early enough unless it is placed in a foreign_decl. 
> When compiling in hlc.gc grade this leads to duplicate declarations unless 
> the variable is placed in foreign_code.
> 
> It seems that foreign_code is the correct place, so does this count as a 
> bug for the asm_fast.gc case?

You can put #ifdefs around it to make sure it doesn't get defined multiple
times.

I believe I argued that this (or something similar) was a bug some time
ago, and lost.

> (I am using mercury-rotd-2002-02-07 and compiling with transitive 
> intermodule optimisation enabled).
> 
> Michael
> 
> --------------------------------------------------------------------------
> mercury-users mailing list
> post:  mercury-users at cs.mu.oz.au
> administrative address: owner-mercury-users at cs.mu.oz.au
> unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
> subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
> --------------------------------------------------------------------------

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list