[m-dev.] For review: Using MR_TypeCtorInfo for generated type_ctor_infos

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 4 18:06:17 AEST 1999


On 04-Aug-1999, Warwick Harvey <wharvey at cs.monash.edu.au> wrote:
> This is for Zoltan or Tyson.
> 
> As per discussions with Z & T, I've been trying to change Mercury so
> that hand-defined type_ctor_info structures use the MR_TypeCtorInfo
> type, rather than having their own.  This is mainly so that it is
> easier for me to merge changes into the HAL branch (which has a an
> extra field in this structure, so I get major conflicts every time
> something gets changed).

If the HAL stuff is sufficiently stable, you might want to consider
committing it into the main branch.   Of course, for this to happen,
any parts in the runtime should be #ifdef'd, any parts in the compiler
should be either #ifdef'd or controlled by a compiler option,
and the changes would have to be reasonably well isolated.

> Anyway, while stumbling around not knowing what I was doing, one thing
> led to another, and now I have a bootstrapped version of the compiler
> which uses the MR_TypeCtorInfo type for all type_ctor_info structures,
> not just the hand-defined ones.  I don't know whether this is the right
> way to go or not (I now know how to change just the hand-defined ones,
> and doing that instead would not be hard).  The drawback with the
> current implementation is that there are *lots* of warnings about
> incompatible pointer types and the like when compiling the C files, and
> at this point I'm not sure what the best way of fixing these is.

Well, if the change is going to cause lots of warnings, then you should
not commit it.  Those warnings ("assignment from incompatible pointer type")
should be treated as errors, since many C compilers do in fact treat them
as such; GNU C is undesirably permissive in this respect.

Changing just the hand-defined ones might still lead to problems,
because the compiler creates compiler-generated declarations for
uses of the hand-defined ones, and these declarations might conflict
with the hand-defined definitions.

Does that help?

-- 
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.
--------------------------------------------------------------------------
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