[m-rev.] for (possibly post-commit) review: simplify the creation of .int files

Julien Fischer jfischer at opturion.com
Mon Feb 18 14:34:35 AEDT 2019


On Mon, 18 Feb 2019, Zoltan Somogyi wrote:

> On Sat, 16 Feb 2019 15:17:29 +0000 (UTC), Julien Fischer <jfischer at opturion.com> wrote:
>>> +            % XXX ITEM_LIST This looks like a lost opportunity to me,
>>> +            % because the only foreign types that *need* the same treatment
>>> +            % as equivalence types are foreign types that are bigger than
>>> +            % one word in size. These should be extremely rare, so it should
>>> +            % be ok to require programmers to signal them with a specific
>>> +            % attribute on the foreign type definition.
>>
>> We do not necessarily know if a foreign type is going to be larger than a word
>> in size, since that can vary depending on the target platform  For example:
>>
>>     :- pragma foreign_type("C", foo, "int64_t").
>>
>> I think the most useful additional annotation we could have on foreign types,
>> would be one that allowed their size (or at least an upper bound on their size)
>> to be specified.
>
> It seems you and I are in agreement, but I don't know whether you meant
> the above to be a request for a clarification of the comment, and if so,
> in what respect.

What I meant was that something like following is not likely to be useful

     :- pragma_foreign_type("C", foo, "some_c_type",
         [larger_than_a_word_sized_type]).

since being word sized or not is likely to vary between target
platforms.  If a new attribute is added then it needs to account for
that.

> Did any issues come up since I committed this diff and its successor?

rotd-2019-02-15 contained this diff; rotd-2019-02-16 contained its
successor, both the builds and subsequent test runs on
testing.mercurylang.org haven't revealed any problems with either diff.

Julien.


More information about the reviews mailing list