[mercury-users] Problem with mmake

Fergus Henderson fjh at cs.mu.OZ.AU
Thu May 31 17:19:31 AEST 2001

On 31-May-2001, Richard A. O'Keefe <ok at atlas.otago.ac.nz> wrote:
> Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> 	The main problem that I can see with your suggested fix is that the code
> 	is POSIX code, but some of the systems that we're trying to port to --
> 	in particular Windows with Mingw or MSVC as the C compiler -- are not
> 	POSIX systems.
> Have you actually *tried* the code under MSVC++, or is this mere
> hypothesis?

I didn't actually try it, but there's similar code using fstat() in the
Mercury standard library which we tried and had to modify because it
didn't work under MSVC.

MS do provide _stat() and _fstat().  But I didn't bother to mention
that, because that is not enough to solve the problem, since they don't
provide readdir() or _readdir().

Also, they only provide _(f)stat() in their Win32 compiler.
The version of the MSVC command-line compiler that is included
in the .NET SDK doesn't support _(f)stat(), even though it does
support the ISO C standard library routines.

> That's 1993.  It would NOT surprise me if MSVC already supported
> opendir(), readdir(), and closedir().

Unfortunately they don't.

> Have you actually _verified_ that MSVC doesn't support opendir()?

Yes.  I checked for it in the MS documentation (which is available on
the web: <http://msdn.microsoft.com/vstudio/>) before my earlier post.

> Note that even if directories were not readable in UNIX, that would not
> be a sufficient answer.  There are so *many* ways that the call to 'cat'
> in mmake can break, and the mmfind program I posted deals with all of them
> that I could think of.  For example, "echo *.d" is perfectly happy to
> report dead links and files that are not readable, but "cat" is not happy
> to copy them!

But in that case "cat" will issue an error message, which is the right
thing to do, given the design constraint that filename pattern "*.d" is
reserved (in directories in which `mmake' is used without `--use-subdirs')
for make dependency files.

You didn't answer my earlier question about `--use-subdirs'.  Perhaps I
can rephrase it: would making `--use-subdirs' the default provide an
adequate solution to this problem for you?  Or is there some reason why
you would continue to use `--no-use-subdirs'?

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-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe

More information about the users mailing list