[m-dev.] Very confusing error message for absolute pathnames (fwd)

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Feb 15 20:22:53 AEDT 2007




---------- Forwarded message ----------
Date: Thu, 15 Feb 2007 16:35:44 +1100
From: Ondrej Bojar <bojar at csse.unimelb.edu.au>
To: mercury-bugs at csse.unimelb.edu.au
Subject: Very confusing error message for absolute pathnames

Hi.

Using mmc --make and supplying the target filename as an absolute path leads to 
a very confusing error message:

mmc /home/obo/mercdevel/wssecargnonabs/bg/hello.o --make
Uncaught Mercury exception:
Software Error: dir./: second argument is absolute
Stack dump not available in this grade.


I've already located the dir./ call: it's the last line of pred make_file_name 
in modules.m.


With the simple command line shown above, one can still quite guess, where the 
error comes from, but the message is deadly uninformative for many command line 
options. One can easily arrive at the message with e.g. this:

mmc --make ... ... ... ... ... --link-object \
<<gmake-did-not-print-anything-here-so-link-object-param-will-swallow-init-file-param>> 
\
--init-file /home/obo/tools/obomerclib/tools.init \
... ... ... testbleu.o

Now try to search for the error if you learned that "second argument is 
absolute"...

I'm not trying to fix it, because I don't know what you'd prefer:

a) disallow full paths for --make at all (and report that as an error right 
away)
b) allow full paths (a fair amount of knowledge of the --make pathname 
construction design is needed to keep the code at the same level of 
clean/dirtyness)

Thanks, Ondrej.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at csse.unimelb.edu.au
Administrative Queries: owner-mercury-developers at csse.unimelb.edu.au
Subscriptions:          mercury-developers-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the developers mailing list