Re: `static` on module-level functions

2023-07-06 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
Yes, static on a free-function does not do anything. ``` ; [#uses = 0] ; Function Attrs: uwtable define void @void onlineapp.func()() #0 { ret void } ``` ``` ; [#uses = 0] ; Function Attrs: uwtable define void @void onlineapp.func()() #0 { ret void } ``` Looks identical to me (LDC, LLVM

`static` on module-level functions

2023-07-06 Thread IchorDev via Digitalmars-d-learn
Can anyone point me to a part of the D spec that says what `static` means when applied to functions that are declared at module scope? (Other than module constructors, obviously) I used to assume the property would do something, so I actually used it in a lot of my code when I was first

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 6 July 2023 at 19:53:39 UTC, Chris Katko wrote: On Thursday, 6 July 2023 at 06:00:04 UTC, Cecil Ward wrote: My program is instrumented with a load of writeflns. At one point it looks as though it suddenly quits prematurely because the expected writeflns are not seen in the output.

Re: gdc 12.1: undefined references when linking separately compiled files

2023-07-06 Thread mw via Digitalmars-d-learn
On Thursday, 6 July 2023 at 22:44:27 UTC, Alexibu wrote: I just encountered this problem in recently released debian bookworm (gdc 12.2.0), I was able to fix these undefined lambdas inside std library with -fall-instantiations, and a bunch of other undefined lambdas in my own code by

Re: gdc 12.1: undefined references when linking separately compiled files

2023-07-06 Thread Alexibu via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:44:56 UTC, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 14:16:51 UTC, kdevel wrote: $ gdc -o ppinsta ppinsta.d parser.d Compiling together is faster anyway this is prolly what you want most the time. But I know what's going on now, it is the template

First module

2023-07-06 Thread Cecil Ward via Digitalmars-d-learn
I’ve written my first non-trivial module in D. See other thread. https://forum.dlang.org/thread/pfjpqcywxrmxwsncy...@forum.dlang.org I’d like to set up something to call it from other modules, and specifically I’d like to see if inlining works across module boundaries - I have no idea whether

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Chris Katko via Digitalmars-d-learn
On Thursday, 6 July 2023 at 06:00:04 UTC, Cecil Ward wrote: My program is instrumented with a load of writeflns. At one point it looks as though it suddenly quits prematurely because the expected writeflns are not seen in the output. It could be that I am just reading the flow of control wrong

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Dukc via Digitalmars-d-learn
On Thursday, 6 July 2023 at 06:00:04 UTC, Cecil Ward wrote: In my limited experience, exceptions produce an error message though, and I’m not seeing anything. Any advice on how to debug this, silent termination ? If unsure on cases like this, test. Intentionally throw an exception and don't

Re: Compiling to RiscV32

2023-07-06 Thread Dukc via Digitalmars-d-learn
On Wednesday, 5 July 2023 at 17:00:53 UTC, HuskyNator wrote: Using a simple single '.d' file with no imports: `Error: cannot find program 'cc'` I haven't tried to compile to RiscV32, nor do know how it works. But this reads like LDC is not finding the C compiler it's trying to use. LDC

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 6 July 2023 at 07:09:11 UTC, Richard (Rikki) Andrew Cattermole wrote: On 06/07/2023 7:07 PM, Cecil Ward wrote: On Thursday, 6 July 2023 at 06:17:34 UTC, Richard (Rikki) Andrew Cattermole wrote: 2 Recommendations: 1. Attach a debugger 2. Make sure to flush stdout whenever you

Re: Options for Cross-Platform 3D Game Development

2023-07-06 Thread Hipreme via Digitalmars-d-learn
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote: So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is,

Re: Options for Cross-Platform 3D Game Development

2023-07-06 Thread Sergey via Digitalmars-d-learn
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote: So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. Are there any other

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Cecil Ward via Digitalmars-d-learn
On Thursday, 6 July 2023 at 06:17:34 UTC, Richard (Rikki) Andrew Cattermole wrote: 2 Recommendations: 1. Attach a debugger 2. Make sure to flush stdout whenever you write I assumed that buffering was to blame. How do I flush stdout? I moved to an x86-64 box. I was using my ARM M2 Mac for

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
On 06/07/2023 7:07 PM, Cecil Ward wrote: On Thursday, 6 July 2023 at 06:17:34 UTC, Richard (Rikki) Andrew Cattermole wrote: 2 Recommendations: 1. Attach a debugger 2. Make sure to flush stdout whenever you write I assumed that buffering was to blame. How do I flush stdout? stdout.flush;

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Andrew via Digitalmars-d-learn
On Thursday, 6 July 2023 at 06:00:04 UTC, Cecil Ward wrote: My program is instrumented with a load of writeflns. At one point it looks as though it suddenly quits prematurely because the expected writeflns are not seen in the output. It could be that I am just reading the flow of control wrong

Re: Options for Cross-Platform 3D Game Development

2023-07-06 Thread Chris Katko via Digitalmars-d-learn
On Wednesday, 5 July 2023 at 22:27:46 UTC, Andrew wrote: So, I've gotten the itch to have a go at game development in D, after doing a bit of it in Java last year. I've previously used LWJGL, which is a java wrapper for OpenGL, OpenAL, GLFW, and some other useful libs. The problem is,

Re: Advice on debugging possible exception or crash

2023-07-06 Thread Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
2 Recommendations: 1. Attach a debugger 2. Make sure to flush stdout whenever you write

Advice on debugging possible exception or crash

2023-07-06 Thread Cecil Ward via Digitalmars-d-learn
My program is instrumented with a load of writeflns. At one point it looks as though it suddenly quits prematurely because the expected writeflns are not seen in the output. It could be that I am just reading the flow of control wrong as it goes ret, ret etc. I’m wondering if it is throwing an