[m-rev.] diff: remove MC++ function implementations from the library
Tyson Dowd
trd at cs.mu.OZ.AU
Wed Aug 15 00:23:16 AEST 2001
On 14-Aug-2001, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> On 13-Aug-2001, Tyson Dowd <trd at miscrit.be> wrote:
> >
> > @@ -566,9 +566,10 @@
> > :- pragma foreign_proc("C", float__radix = (Radix::out),
> > [will_not_call_mercury, thread_safe],
> > "Radix = ML_FLOAT_RADIX;").
> > -:- pragma foreign_proc("MC++", float__radix = (_Radix::out),
> > +:- pragma foreign_proc("C#", float__radix = (_Radix::out),
> > [will_not_call_mercury, thread_safe], "
> > - mercury::runtime::Errors::SORRY(""foreign code for this function"");
> > + mercury.runtime.Errors.SORRY(""foreign code for this function"");
> > + _Radix = 0;
> > ").
>
> Why did you add "_Radix = 0" here?
>
> Is that to suppress a singleton variable warning?
> If so, the fact that the warning occurs is really a problem
> in the Mercury C# interface, and we ought to fix that.
>
> Oh, I guess it is probably due to the C# compiler reporting
> errors about attempts to access variables which may not have
> been initialized. That's a bit harder to avoid.
Sorry, yes, this is to shut the C# compiler up. I only do it for
return values of functions.
> Does C# have anything like GCC's "noreturn" attribute?
Not that I am aware of. I couldn't find anything like this.
You can get around it by throwing an exception -- the the flow control
figures the return will never be excecuted therefore the return value
doesn't need to be definitely assigned.
Tyson.
--------------------------------------------------------------------------
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