ImportC Rox

Don Allen donaldcallen at gmail.com
Fri Nov 11 16:50:32 UTC 2022


On Friday, 11 November 2022 at 15:04:36 UTC, Don Allen wrote:
> On Wednesday, 9 November 2022 at 21:00:11 UTC, Walter Bright 
> wrote:
>> On 11/9/2022 10:54 AM, Don Allen wrote:
>>> Not too surprisingly, given how new ImportC is, more testing 
>>> *has* resulted in problems. I'll have more to say if/when I 
>>> better understand the issue(s).
>>
>> Please post any problems to bugzilla, and tag them with 
>> ImportC. Thanks!
>
> I will. I'm still working on trying to sort this out (with 
> limited time at the moment), so that if a bugzilla report is 
> appropriate, it will be useful.

     Incidental to the issues I've encountered, I should mention 
that the second ImportC example
     in Quick Examples, Section 41.1, does not compile with either 
the current release of dmd or the release candidate, due to the 
conflict between the module and function names:

     (dmd-2.101.0-rc.1)dca at giovanni:/tmp$ dmd demo.d square.c
     demo.d(6): Error: function expected before `()`, not `module 
square` of type `void`

Changing the D code to use the fully qualified function name

     import std.stdio;
     import square;
     void main()
     {
         int i = 7;
         writefln("The square of %s is %s", i, square.square(i));
     }

fixes it. I will file a bugzilla report.





More information about the Digitalmars-d mailing list