[m-rev.] for review: switches on type_ctor_reps

Fergus Henderson fjh at cs.mu.OZ.AU
Tue May 13 15:56:10 AEST 2003


On 12-May-2003, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> 
> Make sure that every switch in the runtime on type constructor representations
> covers all the possible type_ctor_rep values.

> Index: runtime/mercury_ml_expand_body.h
...
> @@ -1163,25 +1167,23 @@
...
>  
>          case MR_TYPECTOR_REP_UNKNOWN:    /* fallthru */
> -        default:
>              MR_fatal_error(MR_STRINGIFY(EXPAND_FUNCTION_NAME)
>                  ": cannot expand -- unknown data type");
> -            break;
>      }
>  }

You seem to be missing a call to MR_fatal_error("unexpected fallthrough")
at the end of the switch there.

> Index: runtime/mercury_tabling.c
> +    MR_fatal_error("MR_table_type:unexpected fallthrough");

s/:/: /

Otherwise, that looks fine.  It may slow the code down a little with
current versions of GCC, due to the extra check before entering the
switch, but I don't think the difference will be important.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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