Varargs issue with LDC

Steven Schveighoffer schveiguy at gmail.com
Wed Jan 31 17:36:26 UTC 2024


On Wednesday, 31 January 2024 at 15:25:44 UTC, Don Allen wrote:
> As mentioned in previous posts, I've written a personal finance 
> manager in D (ported from the original C) that works well when 
> compiled with dmd.
>
> When compiled with ldc, however, it segfaults when I try to 
> perform an operation that involves a call to a varargs function 
> in gtk3. The segfault occurs in the
> bowels of gtk3, but a backtrace in gdb shows that the last 
> thing that happened in my code was the call to the varargs 
> function that I refer to above. At this point I am assuming, 
> but do not know, that the issue is related to the varargs 
> nature of the called gtk function.
>
> This is disappointing. Has anyone experienced a similar issue 
> with ldc or knows of known varargs problems with ldc? I did 
> check the ldc github repository and did not find an open issue 
> that sounds similar to what I'm seeing.
>
> This problem occurred on an up-to-date Arch Linux system with 
> the latest release of ldc installed.

It could be an ABI problem. varargs are weird.

What is the function? Is it possible to make a small example that 
uses gtk3 and still reproduces the issue? Are you defining the 
prototype yourself, or using a binding?

-Steve



More information about the Digitalmars-d mailing list