Compiler switch for integer comparison/promotion to catch a simple error

2022-05-28 Thread frame via Digitalmars-d-learn
Is there a compiler switch to catch this kind of error? ```d ulong v = 1; writeln(v > -1); ``` IMHO the compiler should bail a warning if it sees a logic comparison between signed and unsigned / different integer sizes. There is 50% chance that a implicit conversion was not intended.

Re: dmd 2.099 regression: unittest -checkaction=context and import std.regex cause lots of undefined references

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Friday, 18 March 2022 at 19:42:02 UTC, Anonymouse wrote: On Thursday, 17 March 2022 at 14:00:45 UTC, kdevel wrote: If ```import std.regex;``` is commented out or if ```-checkaction=context``` is removed from the cmd line the unittest passes. Can anybody reproduce this?

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

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 15:10:25 UTC, Steven Schveighoffer wrote: [...] Is this specific to gdc, or does it happen for other compilers as well? The former.

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

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:37:07 UTC, kdevel wrote: dmd: ``` $ dmd -c ppinsta.d $ dmd -c parser.d $ dmd -of=ppinsta ppinsta.o parser.o $ ./ppinsta [] ``` (checking ldc/ldmd2 later) ``` $ ldc2 -c ppinsta.d && ldc2 -c parser.d && ldc2 -of=ppinsta ppinsta.o parser.o && ./ppinsta [] $

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

2022-05-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/28/22 10:44 AM, 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 emission thing, the

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

2022-05-28 Thread kdevel 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

Re: Why is the compiled file size so huge?

2022-05-28 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/27/22 9:40 AM, Alexander Zhirov wrote: I'm trying to compile a file that weighs 3 kilobytes. I'm also linking a self-written dynamic library. I don't understand why the resulting executable file is so huge? After all, all libraries are present: ```sh -rwxr-xr-x 1 root root 6.3M May 27

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

2022-05-28 Thread Adam D Ruppe via Digitalmars-d-learn
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 emission thing, the compiler thinks, since it is from std, it was

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

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:55:09 UTC, Tejas wrote: On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: [...] Is seperate compilation

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

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 14:03:13 UTC, Adam D Ruppe wrote: On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: gdc -o ppinsta ppinsta.o esah.o evaluate.o jsr.o jsw.o parser.o ptvr.o stack.o testdatagenerator.o You might need to add -lgphobos or -lgphobos2 or whatever it is called too

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

2022-05-28 Thread kdevel via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: Any ideas? ppinsta.d ``` import std.stdio : write, writeln; import parser; // <- comment this out and gdc links void main () { string [string] h; writeln (h); } ``` parser.d ``` module parser; import std.regex : regex; private

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

2022-05-28 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: gdc -o ppinsta ppinsta.o esah.o evaluate.o jsr.o jsw.o parser.o ptvr.o stack.o testdatagenerator.o You might need to add -lgphobos or -lgphobos2 or whatever it is called too explicitly.

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

2022-05-28 Thread Tejas via Digitalmars-d-learn
On Saturday, 28 May 2022 at 13:12:46 UTC, kdevel wrote: I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: [...] Is seperate compilation working successfully for dmd and ldc? The only bug I know

gdc 12.1: undefined references when linking separately compiled files

2022-05-28 Thread kdevel via Digitalmars-d-learn
I am trying to build a project with GDC. It successfully compiles with dmd and ldmd2. When I use gdc in one go the binary is successfully build: ``` $ gdc -o ppinsta esah.d evaluate.d jsr.d jsw.d parser.d ppinsta.d ptvr.d stack.d testdatagenerator.d ``` Though after compiling separately the

Re: Why is the compiled file size so huge?

2022-05-28 Thread zjh via Digitalmars-d-learn
On Friday, 27 May 2022 at 13:40:25 UTC, Alexander Zhirov wrote: I'm trying to compile a file that weighs 3 kilobytes. I'm also linking a self-written dynamic library. I don't understand why the resulting executable file is so huge? I just switched from `32-bit` to 64 bit, but the '64' bit

Re: Why is the compiled file size so huge?

2022-05-28 Thread user1234 via Digitalmars-d-learn
On Friday, 27 May 2022 at 13:40:25 UTC, Alexander Zhirov wrote: I'm trying to compile a file that weighs 3 kilobytes. I'm also linking a self-written dynamic library. I don't understand why the resulting executable file is so huge? After all, all libraries are present: I'd take a look with

Re: Why is the compiled file size so huge?

2022-05-28 Thread rempas via Digitalmars-d-learn
On Friday, 27 May 2022 at 13:40:25 UTC, Alexander Zhirov wrote: I'm trying to compile a file that weighs 3 kilobytes. I'm also linking a self-written dynamic library. I don't understand why the resulting executable file is so huge? After all, all libraries are present: [...] I did a similar

Re: UI Library

2022-05-28 Thread Sergey via Digitalmars-d-learn
On Saturday, 28 May 2022 at 02:39:41 UTC, Jack wrote: On Friday, 20 May 2022 at 12:32:37 UTC, ryuukk_ wrote: Avoid GTK, it's bloated, GTK4 looks like a toolkit to design mobile apps, and you need runtime dependencies on windows adam's gui library is very nice, 0 dependencies I personally