[m-rev.] for review: fix warnings on x86_64

Ian MacLarty maclarty at cs.mu.OZ.AU
Wed Aug 31 12:35:41 AEST 2005


On Wed, 31 Aug 2005, Mark Brown wrote:

> Hi,
>
> Most of this is straightforward.  The main question is what to do about
> the XXX comment in runtime/mercury_types.h.  I'm not sure what should be
> done here, or even if this is a problem at all.
>

Which comment do you mean?  I don't see an XXX in mercury_types.h in the
diff.

> Index: runtime/mercury_proc_id.h
> ===================================================================
> RCS file: /home/mercury1/repository/mercury/runtime/mercury_proc_id.h,v
> retrieving revision 1.4
> diff -u -r1.4 mercury_proc_id.h
> --- runtime/mercury_proc_id.h	23 May 2004 22:16:51 -0000	1.4
> +++ runtime/mercury_proc_id.h	30 Aug 2005 14:06:54 -0000
> @@ -15,7 +15,10 @@
>  /*
>  ** This type indicates whether a procedure came from a predicate or a function.
>  ** This enum should EXACTLY match the definition of the `pred_or_func' type
> -** in browser/util.m.
> +** in mdbcomp/prim_data.m.
> +**
> +** XXX enums have type int, which is 32 bits on x86_64, whereas the
> +** pred_or_func type is 64 bits.
>  */
>

Is this likely to cause any problems?  If you assign the enum to a 64 bit
word will the higher bits be zeroed out?  If you compare a small 32-bit value
with the same value in 64-bits will they compare as equal?

>  typedef	enum {
> @@ -24,12 +27,15 @@
>  } MR_PredFunc;
>
>  /*
> -** MR_Proc_Id is a union. The usual alternative identifies ordinary
> -** procedures, while the other alternative identifies automatically generated
> -** unification, comparison and index procedures. The meanings of the fields
> -** in both forms are the same as in procedure labels. The runtime system
> -** can figure out which form is present by using the macro MR_PROC_ID_IS_UCI,
> -** which will return true only if the procedure is of the second type.
> +** MR_Proc_Id is a union. The first alternative identifies ordinary
> +** procedures, while the second alternative identifies automatically generated
> +** unification, comparison and index procedures.  The third alternative

Should initialise precedures be included in this list?

Otherwise that looks fine, though could you please bootcheck in the decldebug
grade since it makes use of the fact that MR_PredFunc should be the same
as the Mercury type.

Ian.

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list