[m-dev.] Warning compiling io.c

Thomas Charles CONWAY conway at students.cs.mu.oz.au
Tue Feb 11 11:09:36 AEDT 1997


> > Hi
> > 
> > The following warning:
> > io.c: In function `mercury__io_module100':
> > io.c:5418: warning: assignment makes integer from pointer without a cast
> > when compiling io.c seems to come from std_util.m (via cross module inlining).
> > I think it might be necessary to put some casts in the univ-handling code.
> > Fergus, is this yours? Tyson maybe?
> 
> I'll fix it.
> 
> It's caused by this, in io__init_state:
> 
>         type_to_univ("<globals>", Globals),
> 
> this generates C code declaration of Type as:
> 
> 	String Type;
> 
> which has the impressively casted initialization of
> 
> 	Type = (String) (Word) (const Word *) string_const("<globals>", 9);
> 
> and, since it's a string, doesn't mesh well with this:
> 
> 	field(mktag(0), Univ, UNIV_OFFSET_FOR_DATA) = Type;
> 
> The fix is, of course, this:
> 
> Index: std_util.m

The diff looks fine. Commit it.

-- 
Thomas Conway               				      conway at cs.mu.oz.au
AD DEUM ET VINUM	  "Thomas Tallis is dead, and muic dies." - William Byrd



More information about the developers mailing list