[m-dev.] for review: shut up a warning

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 18 16:40:31 AEDT 2001


On 18-Jan-2001, Zoltan Somogyi <zs at cs.mu.OZ.AU> wrote:
> Shut up a warning.
> 
> browser/dl.m:
> 	Add #include <string.h>.
> 
> browser/Mmakefile:
> 	Add --no-ansi to MGNUC_FLAGS, to allow string.h to define strdup.

strdup() is not portable.  The call to it in dl.m will lead to a memory
leak.  So that's not the right fix.

The right fix is probably to use MR_make_string() rather than
sprintf() and strdup().

The code using strdup() seems to have been committed already, but it
was never posted to mercury-developers.  Please don't do that!

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