Module system bug?

Fergus Henderson fjh at cs.mu.oz.au
Fri Feb 7 17:38:03 AEDT 1997


Tyson Richard DOWD, you wrote:
> 
> What happens when you have 
> 	foo__do_this
> and
> 	do_this
> in the same module? 
> 
> This does:
> 
> foo.c:17: warning: static declaration for `mercury__foo__do_this_2_0' follows non-static
> as0: Error: foo.c, line 5: Conflicting definition of symbol entry_mercury__foo__do_this_2_0
> Error: system command returned non-zero exit status.
> Error: problem compiling C file.
> For more information, try recompiling with `-E'.

The reason for this is that `foo__' is considered to be a module
qualifier and so is not encoded in the mangled symbol name.

Sometime soon I would like to change the compiler to parse
`foo__do_this' as `foo:do_this'.  If this were done, then the compiler
would detect the multiple definition error before generating code.  I
have a patch which implements that change, but because we haven't
implemented module qualifiers on data constructors (e.g. `term__variable')
yet, this breaks too many things.

So, the fix for the above bug is for someone to implement module
qualifiers on data constructors.  (Any volunteers? ;-)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list