[m-rev.] diff: fix .module_dep files
Julien Fischer
juliensf at csse.unimelb.edu.au
Tue Jul 22 21:46:51 AEST 2008
On Tue, 22 Jul 2008, Zoltan Somogyi wrote:
> On 22-Jul-2008, Peter Wang <novalazy at gmail.com> wrote:
>> The recent renaming of the constructor `no_foreign_export' to
>> `contains_no_foreign_export' broke `.module_dep' files. The offending field
>> was written out directly with `io.write', so the renaming changed the file
>> format, but the parser still expected the old spelling "no_foreign_export".
>>
>> `mmc --make' would then try to remake all the `.module_dep' files it
>> couldn't parse, including modules whose source files we don't have at hand.
>>
>> compiler/make.module_dep_file.m:
>> Fix the bug.
>>
>> Try to avoid a similar bug in another field.
>
> That looks great; thanks Peter. However, "grep -w io.write make*.m" gives
> five matches even after applying this diff. Will you please fix those as well?
> And does anyone else know of any other cases where the compiler is depending
> in the exact spelling of a function symbol to define part of a file format?
Extending the above search to the all the compiler modules shows that we
are calling io.write in a bunch of other places as well, e.g. in ilasm.m
I think we should avoid calling it in the compiler except in debugging
code. I suggest we add something along those lines to coding standard.
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list