Re: Weird std.path API?

2024-07-08 Thread user1234 via Digitalmars-d-learn
On Monday, 8 July 2024 at 07:29:27 UTC, aberba wrote: On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote: On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote: On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote: ```d import std.path; // Error: no property

Re: Weird std.path API?

2024-07-08 Thread aberba via Digitalmars-d-learn
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote: On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote: On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote: ```d import std.path; // Error: no property `asNormaliedPath` for `dirName("/sandbox/onlineapp.d")` of type

Re: Weird std.path API?

2024-07-07 Thread user1234 via Digitalmars-d-learn
On Sunday, 7 July 2024 at 15:35:36 UTC, Andrey Zherikov wrote: On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote: On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote: ```d import std.path; // Error: no property `asNormaliedPath` for `dirName("/sandbox/onlineapp.d")` of type

Re: Weird std.path API?

2024-07-07 Thread Andrey Zherikov via Digitalmars-d-learn
On Sunday, 7 July 2024 at 14:49:52 UTC, Anonymouse wrote: On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote: ```d import std.path; // Error: no property `asNormaliedPath` for `dirName("/sandbox/onlineapp.d")` of type `string` auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath;

Re: Weird std.path API?

2024-07-07 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jul 07, 2024 at 02:41:31PM +, Andrey Zherikov via Digitalmars-d-learn wrote: > Seems different functions in std.path do not work together: > ```d > import std.path; > > // Error: no property `asNormaliedPath` for > `dirName("/sandbox/onlineapp.d")` of type `string` > auto p =

Re: Weird std.path API?

2024-07-07 Thread Anonymouse via Digitalmars-d-learn
On Sunday, 7 July 2024 at 14:41:31 UTC, Andrey Zherikov wrote: ```d import std.path; // Error: no property `asNormaliedPath` for `dirName("/sandbox/onlineapp.d")` of type `string` auto p = __FILE_FULL_PATH__.dirName.asNormaliedPath; ``` `asNormalizedPath` is misspelled.

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Arafel via Digitalmars-d-learn
On 1/11/23 18:26, Christian Köstlin wrote: It's really weird: https://run.dlang.io/is/fIBR2n I think I might have found out the issue. It's indeed related to the lazy parameter and reentrance. The usual logger functions consist of three parts: a header, the message, and the "finalizer

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread matheus via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 17:26:42 UTC, Christian Köstlin wrote: ... It's really weird: https://run.dlang.io/is/fIBR2n Interesting because I wrote a similar test as you did. And that increment (Or lack of) called my attention, If I can I'll try and take a look at that (std.logger

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Christian Köstlin via Digitalmars-d-learn
n foo"); return "Hello, world."; } ``` ... Unless you do: string s; info(s=foo()); I think this is a bug, or at least very weird behavior. Matheus. It's really weird: https://run.dlang.io/is/fIBR2n

Re: Weird RDMD error when trying to import source file from subfolder.

2023-11-01 Thread Julian Fondren via Digitalmars-d-learn
On Wednesday, 1 November 2023 at 16:24:04 UTC, BoQsc wrote: **Error:** ``` rdmd testimport.d testimport.d(2): Error: module `next` from file waffle\next.d must be imported with 'import next;' ``` You import 'waffle.next', but the module is inferred to be 'next'. If put `module

Weird RDMD error when trying to import source file from subfolder.

2023-11-01 Thread BoQsc via Digitalmars-d-learn
I'm unable to import a `.d` source file from a subfolder. Now this happens only with `rdmd`. The `dmd -i -run` works perfectly. I'm currently on Windows 10 operating system. **./testimport.d**: ``` import std; import waffle.next; void main(){ writeln("test", testing); } ```

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread matheus via Digitalmars-d-learn
... Unless you do: string s; info(s=foo()); I think this is a bug, or at least very weird behavior. Matheus.

Re: Weird bug in std.logger? Possible memory corruption

2023-11-01 Thread Arafel via Digitalmars-d-learn
I can only imagine that it's related to the logging functions taking lazy arguments, although I cannot see why it would be a problem in a simple case like this. I've been thinking a bit more about it, and it must be indeed because of the lazy argument. `foo()` is an argument to `info`, but

Weird bug in std.logger? Possible memory corruption

2023-10-31 Thread Arafel via Digitalmars-d-learn
Hi, Today I have just found a weird bug in std.logger. Consider: ```d import std.logger : info; void main() { info(foo()); } auto foo() { info("In foo"); return "Hello, world."; } ``` The output is: ``` 2023-10-31T20:41:05.274 [info] onlineapp.d:8:foo In

Re: C to D: please help translate this weird macro

2023-09-23 Thread Ki Rill via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm trying to translate the Nuklear GUI library to D

Re: C to D: please help translate this weird macro

2023-09-22 Thread Ki Rill via Digitalmars-d-learn
On Thursday, 21 September 2023 at 16:50:51 UTC, Imperatorn wrote: On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ```

Re: C to D: please help translate this weird macro

2023-09-22 Thread Ki Rill via Digitalmars-d-learn
On Thursday, 21 September 2023 at 16:28:25 UTC, Nick Treleaven wrote: The 1st argument of `getMember` can just be T, like the original macro. The 2nd argument needs to be a compile-time string. Also the `char*` cast needs to apply to `ptr` before subtracting the offset AFAICS. So

Re: C to D: please help translate this weird macro

2023-09-21 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm trying to translate the Nuklear GUI library to D

Re: C to D: please help translate this weird macro

2023-09-21 Thread user1234 via Digitalmars-d-learn
On Thursday, 21 September 2023 at 16:28:25 UTC, Nick Treleaven wrote: (Untested) There might be a `need this` error

Re: C to D: please help translate this weird macro

2023-09-21 Thread Nick Treleaven via Digitalmars-d-learn
On Thursday, 21 September 2023 at 16:28:25 UTC, Nick Treleaven wrote: return cast(T*)(cast(void*)(cast(char*)ptr - __traits(getMember, T, member).offsetof))); There's a trailing `)` that needs removing. Also pretty sure it can be simplified to: return cast(T*)(cast(char*)ptr

Re: C to D: please help translate this weird macro

2023-09-21 Thread Nick Treleaven via Digitalmars-d-learn
On Thursday, 21 September 2023 at 02:57:07 UTC, Ki Rill wrote: On Thursday, 21 September 2023 at 02:23:32 UTC, Ki Rill wrote: wrote: [...] Translated it to this eventually: ```D auto nk_container_of(P, T)(P ptr, T type, const(char)* member) { return cast(T*)(cast(void*)(cast(char*)

Re: C to D: please help translate this weird macro

2023-09-20 Thread Ki Rill via Digitalmars-d-learn
On Thursday, 21 September 2023 at 02:23:32 UTC, Ki Rill wrote: wrote: [...] Translated it to this eventually: ```D auto nk_container_of(P, T)(P ptr, T type, const(char)* member) { return cast(T*)(cast(void*)(cast(char*) (ptr - __traits(getMember, type, member).offsetof))); } ```

Re: C to D: please help translate this weird macro

2023-09-20 Thread Ki Rill via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 17:14:41 UTC, Dejan Lekic wrote: [...] NK_CONTAINER_OF should probably be translated to: `cast(T*)((cast(void*)ptr - __traits(getMember, T, member).offsetof))` PS. I did not invent this. My original idea was far worse than this. - It was suggested on IRC

Re: C to D: please help translate this weird macro

2023-09-20 Thread Dejan Lekic via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:55:14 UTC, Ki Rill wrote: On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm

Re: C to D: please help translate this weird macro

2023-09-20 Thread ryuukk_ via Digitalmars-d-learn
](https://github.com/rillki/nuklear-d/tree/nuklear-d-translation). My workflow when trying to port weird C code to D is to have a small C file, put an example code, and then run the preprocessor, and try to get how things are expanded Alternatively, latest version of visual studio allows you

Re: C to D: please help translate this weird macro

2023-09-20 Thread Dejan Lekic via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:55:14 UTC, Ki Rill wrote: On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm

Re: C to D: please help translate this weird macro

2023-09-20 Thread Ki Rill via Digitalmars-d-learn
On Wednesday, 20 September 2023 at 13:53:08 UTC, Ki Rill wrote: Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm trying to translate the Nuklear GUI library to D

C to D: please help translate this weird macro

2023-09-20 Thread Ki Rill via Digitalmars-d-learn
Here is the macro: ```C #define NK_CONTAINER_OF(ptr,type,member)\ (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member))) ``` I'm trying to translate the Nuklear GUI library to D [here](https://github.com/rillki/nuklear-d/tree/nuklear-d-translation).

Re: Weird floating point rounding - Bug or how to control it correctly

2023-09-13 Thread Basile B. via Digitalmars-d-learn
On Thursday, 14 September 2023 at 03:23:48 UTC, An Pham wrote: import std.stdio; void main() { float f = 6394763.345f; import std.format : sformat; char[80] vBuffer = void; writeln("6394763.345 = ", sformat(vBuffer[], "%.4f", f));

Re: Weird floating point rounding - Bug or how to control it correctly

2023-09-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, September 13, 2023 9:23:48 PM MDT An Pham via Digitalmars-d- learn wrote: > import std.stdio; > > void main() > { > float f = 6394763.345f; > > import std.format : sformat; > > char[80] vBuffer = void; > writeln("6394763.345 = ",

Weird floating point rounding - Bug or how to control it correctly

2023-09-13 Thread An Pham via Digitalmars-d-learn
import std.stdio; void main() { float f = 6394763.345f; import std.format : sformat; char[80] vBuffer = void; writeln("6394763.345 = ", sformat(vBuffer[], "%.4f", f)); } Output 6394763.345 = 6394763.5000

Re: Weird template instantiation speed?

2023-07-09 Thread IchorDev via Digitalmars-d-learn
On Sunday, 9 July 2023 at 14:49:39 UTC, Steven Schveighoffer wrote: This is probably a bug somewhere, 4 seconds is too much. A reduced test case would be helpful. But I wanted to note, inside a struct template, the template name (by itself) is equivalent to the current instantiation. So

Re: Weird template instantiation speed?

2023-07-09 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/9/23 7:54 AM, IchorDev wrote: While working on some new bindings, I've discovered that if `opAssign` in a struct template "`BindingTempl(T)`" has the return type "`BindingTempl!T` then it adds about 4 seconds to the compile time per instantiation of `BindingTempl`. The added compile time

Weird template instantiation speed?

2023-07-09 Thread IchorDev via Digitalmars-d-learn
While working on some new bindings, I've discovered that if `opAssign` in a struct template "`BindingTempl(T)`" has the return type "`BindingTempl!T` then it adds about 4 seconds to the compile time per instantiation of `BindingTempl`. The added compile time is much lower if a function other

[Issue 23950] Weird backend fail with noreturn type - cod1.d(4027): Assertion failure

2023-05-31 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23950 RazvanN changed: What|Removed |Added Keywords||backend, ice CC|

[Issue 23950] Weird backend fail with noreturn type - cod1.d(4027): Assertion failure

2023-05-31 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23950 --- Comment #1 from m...@ernestocastellotti.it --- The absurd thing is that instead this code compiles and works correctly: import core.stdc.stdlib; void main() { auto foo = (false != true) && true || abort(); } This looks just like a bad bug

[Issue 23950] New: Weird backend fail with noreturn type - cod1.d(4027): Assertion failure

2023-05-31 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=23950 Issue ID: 23950 Summary: Weird backend fail with noreturn type - cod1.d(4027): Assertion failure Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: A weird example of .toUTF16z concatination side-effects in wcsncat

2022-04-07 Thread BoQsc via Digitalmars-d-learn
On Thursday, 7 April 2022 at 12:51:26 UTC, Stanislav Blinov wrote: On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote: wchar_t* clang_string = cast(wchar_t *)"AA"; You're witnessing undefined behavior. "AA" is a string literal and is stored in the data

Re: A weird example of .toUTF16z concatination side-effects in wcsncat

2022-04-07 Thread Stanislav Blinov via Digitalmars-d-learn
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote: wchar_t* clang_string = cast(wchar_t *)"AA"; You're witnessing undefined behavior. "AA" is a string literal and is stored in the data segment. Mere cast to wchar_t* does not make writing through that

Re: A weird example of .toUTF16z concatination side-effects in wcsncat

2022-04-07 Thread BoQsc via Digitalmars-d-learn
On Thursday, 7 April 2022 at 11:03:39 UTC, Tejas wrote: On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote: Here I try to concatenate three character strings using `wcsncat()`. [...] Maybe try using `wstring` instead of string? Also use the `w` postfix ```d wstring dlang_string =

Re: A weird example of .toUTF16z concatination side-effects in wcsncat

2022-04-07 Thread Tejas via Digitalmars-d-learn
On Thursday, 7 April 2022 at 10:50:35 UTC, BoQsc wrote: Here I try to concatenate three character strings using `wcsncat()`. [...] Maybe try using `wstring` instead of string? Also use the `w` postfix ```d wstring dlang_string = "BBB"w; I can't test because I'm not on my PC and I

A weird example of .toUTF16z concatination side-effects in wcsncat

2022-04-07 Thread BoQsc via Digitalmars-d-learn
Here I try to concatenate three character strings using `wcsncat()`. `clang_string` AA `dlang_string` BBB `winpointer_to_string` CC ``` import std.stdio; @system void main(){ import std.utf: toUTF16z, toUTF16; import

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/23/21 3:30 PM, apz28 wrote: On Friday, 23 July 2021 at 18:44:47 UTC, Steven Schveighoffer wrote: On 7/22/21 7:43 PM, apz28 wrote: In any case, it's possible that fbConnection being null does not mean a null dereference, but I'd have to see the class itself. I'm surprised if you don't

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-23 Thread Ali Çehreli via Digitalmars-d-learn
On 7/23/21 12:30 PM, apz28 wrote: > The -debug build with passing unit-tests so no problem there. > The -release build is having problem. After make change to accommodate > it, it takes forever to build. I started it yesterday 11AM and it is > still compiling now (more than a day already.) It

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-23 Thread apz28 via Digitalmars-d-learn
On Friday, 23 July 2021 at 18:44:47 UTC, Steven Schveighoffer wrote: On 7/22/21 7:43 PM, apz28 wrote: In any case, it's possible that fbConnection being null does not mean a null dereference, but I'd have to see the class itself. I'm surprised if you don't get a null dereference in

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-23 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/22/21 7:43 PM, apz28 wrote: FbConnection is a class, FbXdrReader is a struct and for this call, response.data is not null & its' length will be greater than zero and FbConnection is not being used. So why DMD try to evaluate at compiled time hence error 1. Should not evaluate at compile

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-22 Thread apz28 via Digitalmars-d-learn
On Thursday, 22 July 2021 at 18:56:43 UTC, Steven Schveighoffer wrote: On 7/22/21 2:38 PM, apz28 wrote: On Wednesday, 21 July 2021 at 20:39:54 UTC, Dukc wrote: On Wednesday, 21 July 2021 at 14:15:51 UTC, Steven Schveighoffer wrote: 2. It's hard for me to see where the null dereference would

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-22 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/22/21 2:38 PM, apz28 wrote: On Wednesday, 21 July 2021 at 20:39:54 UTC, Dukc wrote: On Wednesday, 21 July 2021 at 14:15:51 UTC, Steven Schveighoffer wrote: 2. It's hard for me to see where the null dereference would be in that function (the `bool` implementation is pretty simple). DMD

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-22 Thread apz28 via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 20:39:54 UTC, Dukc wrote: On Wednesday, 21 July 2021 at 14:15:51 UTC, Steven Schveighoffer wrote: 2. It's hard for me to see where the null dereference would be in that function (the `bool` implementation is pretty simple). -Steve DMD complains about

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-21 Thread Dukc via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 14:15:51 UTC, Steven Schveighoffer wrote: 2. It's hard for me to see where the null dereference would be in that function (the `bool` implementation is pretty simple). -Steve DMD complains about dereferences in three different lines. I suspect it's `this`

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-21 Thread Steven Schveighoffer via Digitalmars-d-learn
On 7/21/21 7:56 AM, apz28 wrote: On Wednesday, 21 July 2021 at 11:52:39 UTC, apz28 wrote: On Wednesday, 21 July 2021 at 04:52:44 UTC, Mathias LANG wrote: It seems the compiler is doing extra analysis and seeing that a null pointer is being dereferenced. Can you provide the code for

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-21 Thread bauss via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 03:25:03 UTC, apz28 wrote: VisualD project - Any hint to work around DMD version: DMD32 D Compiler v2.096.0-rc.1-dirty Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright Failed Build Command line: dmd -release

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-21 Thread apz28 via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 11:52:39 UTC, apz28 wrote: On Wednesday, 21 July 2021 at 04:52:44 UTC, Mathias LANG wrote: It seems the compiler is doing extra analysis and seeing that a null pointer is being dereferenced. Can you provide the code for "pham\db\db_skdatabase.d" at L138 through

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-21 Thread apz28 via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 04:52:44 UTC, Mathias LANG wrote: It seems the compiler is doing extra analysis and seeing that a null pointer is being dereferenced. Can you provide the code for "pham\db\db_skdatabase.d" at L138 through 140 ? ```d package(pham.db): // Line# 133

Re: How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-20 Thread Mathias LANG via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 03:25:03 UTC, apz28 wrote: with below error message: ..\..\pham\db\db_skdatabase.d(140): Error: null dereference in function _D4pham2db10fbdatabase7FbArray__T13readArrayImplTbZQsMFNfCQCeQCc8database12DbNameColumnZAb ..\..\pham\db\db_skdatabase.d(139): Error: null

How to Fix Weird Build Failure with "-release" but OK with "-debug"?

2021-07-20 Thread apz28 via Digitalmars-d-learn
VisualD project - Any hint to work around DMD version: DMD32 D Compiler v2.096.0-rc.1-dirty Copyright (C) 1999-2021 by The D Language Foundation, All Rights Reserved written by Walter Bright Failed Build Command line: dmd -release -m32mscoff -O -inline -dip25 -dip1000 -preview=fixAliasThis

Re: Visual D showing weird errors

2021-04-28 Thread Imperatorn via Digitalmars-d-learn
On Wednesday, 28 April 2021 at 06:06:47 UTC, Rainer Schuetze wrote: On 26/04/2021 20:22, Imperatorn wrote: On Monday, 26 April 2021 at 17:37:26 UTC, Rainer Schuetze wrote: On 26/04/2021 10:00, Raimondo Mancino wrote: [...] The problem is that the semantic engine used by Visual D is

Re: Visual D showing weird errors

2021-04-28 Thread Rainer Schuetze via Digitalmars-d-learn
On 26/04/2021 20:22, Imperatorn wrote: > On Monday, 26 April 2021 at 17:37:26 UTC, Rainer Schuetze wrote: >> >> On 26/04/2021 10:00, Raimondo Mancino wrote: >>> [...] >> >> The problem is that the semantic engine used by Visual D is working >> with the DMD frontend of 2.095, but "noreturn" is a

Re: Visual D showing weird errors

2021-04-26 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 April 2021 at 17:37:26 UTC, Rainer Schuetze wrote: On 26/04/2021 10:00, Raimondo Mancino wrote: [...] The problem is that the semantic engine used by Visual D is working with the DMD frontend of 2.095, but "noreturn" is a new language feature introduced with 2.096. You can

Re: Visual D showing weird errors

2021-04-26 Thread Rainer Schuetze via Digitalmars-d-learn
hese. > > I was trying the Visual D extension to Visual Studio, but after the > first code generation (DLL library, x86 & x64 both checked), I get this > weird error: > > ``` > C:\D\dmd2\src\druntime\import\core\sys\windows\dll.d: > \object.d(18): can only `*` a pointer,

Re: Visual D showing weird errors

2021-04-26 Thread Raimondo Mancino via Digitalmars-d-learn
On Monday, 26 April 2021 at 15:54:36 UTC, Adam D. Ruppe wrote: Do you have a separate object.d in your current directory? That can cause all kinds of weird errors. Otherwise I suspect this is a conflict between two versions of the compiler. If you had one installed before then updated

Re: Visual D showing weird errors

2021-04-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 26 April 2021 at 08:00:08 UTC, Raimondo Mancino wrote: C:\D\dmd2\src\druntime\import\core\sys\windows\dll.d: \object.d(18): can only `*` a pointer, not a `typeof(null)` Do you have a separate object.d in your current directory? That can cause all kinds of weird errors. Otherwise

Re: Visual D showing weird errors

2021-04-26 Thread Raimondo Mancino via Digitalmars-d-learn
On Monday, 26 April 2021 at 14:17:34 UTC, Imperatorn wrote: Also, be sure to join on Discord as well (https://discord.gg/bMZk9Q4) if you're not already there! Thank you, I think I'll join.

Re: Visual D showing weird errors

2021-04-26 Thread Johann Lermer via Digitalmars-d-learn
On Monday, 26 April 2021 at 10:42:54 UTC, Mike Parker wrote: (According to -v: DMD64 D Compiler v2.096.0-dirty) That's actually normal for the Windows versions. I'm not sure where it comes from, but it's always there. Ouuu, that's bad advertising, isn't it? Who wants to use dirty software, it

Re: Visual D showing weird errors

2021-04-26 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 April 2021 at 11:03:19 UTC, Raimondo Mancino wrote: On Monday, 26 April 2021 at 10:44:14 UTC, Mike Parker wrote: You might try to build outside of VS and see if you get the same errors. The weird thing is that I get these errors just in the errors frame, but building works just

Re: Visual D showing weird errors

2021-04-26 Thread Mike Parker via Digitalmars-d-learn
On Monday, 26 April 2021 at 11:03:19 UTC, Raimondo Mancino wrote: On Monday, 26 April 2021 at 10:44:14 UTC, Mike Parker wrote: You might try to build outside of VS and see if you get the same errors. The weird thing is that I get these errors just in the errors frame, but building works just

Re: Visual D showing weird errors

2021-04-26 Thread Raimondo Mancino via Digitalmars-d-learn
On Monday, 26 April 2021 at 10:44:14 UTC, Mike Parker wrote: You might try to build outside of VS and see if you get the same errors. The weird thing is that I get these errors just in the errors frame, but building works just fine without errors. If I run devenv.exe directly

Re: Visual D showing weird errors

2021-04-26 Thread Mike Parker via Digitalmars-d-learn
On Monday, 26 April 2021 at 10:40:44 UTC, Johann Lermer wrote: On Monday, 26 April 2021 at 08:58:25 UTC, Raimondo Mancino wrote: According to -v: DMD64 D Compiler v2.096.0-dirty Well, that says it all, doesn't it? I'm not familiar with the windows versions, but that doesn't seem to be an

Re: Visual D showing weird errors

2021-04-26 Thread Mike Parker via Digitalmars-d-learn
On Monday, 26 April 2021 at 08:00:08 UTC, Raimondo Mancino wrote: Since these are thrown by the standard library, I suspect this could be a bug; but maybe I'm just missing something? Thank you for your help. You might try to build outside of VS and see if you get the same errors.

Re: Visual D showing weird errors

2021-04-26 Thread Johann Lermer via Digitalmars-d-learn
On Monday, 26 April 2021 at 08:58:25 UTC, Raimondo Mancino wrote: According to -v: DMD64 D Compiler v2.096.0-dirty Well, that says it all, doesn't it? I'm not familiar with the windows versions, but that doesn't seem to be an offical release - at least I never had a dmd2 that claimed to be

Re: Visual D showing weird errors

2021-04-26 Thread Raimondo Mancino via Digitalmars-d-learn
On Monday, 26 April 2021 at 08:40:01 UTC, Imperatorn wrote: On Monday, 26 April 2021 at 08:00:08 UTC, Raimondo Mancino wrote: Hello, I'm new to the language; I just started learning it a few months ago. I'm doing okay with it, I find it very versatile and fast to learn. I come from Java and

Re: Visual D showing weird errors

2021-04-26 Thread Imperatorn via Digitalmars-d-learn
On Monday, 26 April 2021 at 08:00:08 UTC, Raimondo Mancino wrote: Hello, I'm new to the language; I just started learning it a few months ago. I'm doing okay with it, I find it very versatile and fast to learn. I come from Java and C/C++ and I think D solves tons of problems I had with these.

Visual D showing weird errors

2021-04-26 Thread Raimondo Mancino via Digitalmars-d-learn
the first code generation (DLL library, x86 & x64 both checked), I get this weird error: ``` C:\D\dmd2\src\druntime\import\core\sys\windows\dll.d: \object.d(18): can only `*` a pointer, not a `typeof(null)` ``` So I opened the object.d in VS and apparently, this is the line of code it's yel

Re: weird formattedRead

2021-04-09 Thread Ali Çehreli via Digitalmars-d-learn
On 4/9/21 11:17 AM, Berni44 wrote: > I'm on reworking completely the docs of `std.format`. Awesome! :) Ali

Re: weird formattedRead

2021-04-09 Thread Berni44 via Digitalmars-d-learn
On Friday, 9 April 2021 at 16:11:26 UTC, Oleg B wrote: valid '1/1/1': 0001-Jan-01 00:00:00 <<< see here [...] Is space a special char for `formattedRead` and it simple stop parse without throwing exception if not found space (that represented in fmt string)? Have `formattedRead` any other

Re: weird formattedRead

2021-04-09 Thread frame via Digitalmars-d-learn
On Friday, 9 April 2021 at 16:11:26 UTC, Oleg B wrote: Is space a special char for `formattedRead` and it simple stop parse without throwing exception if not found space (that represented in fmt string)? Have `formattedRead` any other special chars? Or it's bug? I think it's a bug: The

Re: weird formattedRead

2021-04-09 Thread Ali Çehreli via Digitalmars-d-learn
On 4/9/21 9:11 AM, Oleg B wrote: > Is space a special char for `formattedRead` and it simple stop parse > without throwing exception if not found space Yes: The space character means "zero or more white space". Ali P.S. I can't check whether the D standard library documentation includes that

weird formattedRead

2021-04-09 Thread Oleg B via Digitalmars-d-learn
Hello, I have some doubts about working `formattedRead` with space chars. Example: ```d import std : formattedRead, DateTime, stderr, each; DateTime parseDT(string str) { int d,mo,y, h,m,s; formattedRead!"%d/%d/%d %d:%d:%d"(str, d,mo,y, h,m,s); return DateTime(y,mo,d, h,m,s); }

Re: Weird interaction with public and non-public imports

2021-01-28 Thread SealabJaster via Digitalmars-d-learn
On Thursday, 28 January 2021 at 13:13:46 UTC, Paul Backus wrote: ... https://issues.dlang.org/show_bug.cgi?id=21589 These issues are always so subtle and specific yet so annoying, e.g.: https://issues.dlang.org/show_bug.cgi?id=21496 and https://issues.dlang.org/show_bug.cgi?id=21377

Re: Weird interaction with public and non-public imports

2021-01-28 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 28 January 2021 at 13:07:13 UTC, SealabJaster wrote: Please see: https://run.dlang.io/is/2mwcPH I'd expect that the `isInstanceOf` would be true instead of false here. Commenting out the public import changes the output of `fullyQualifiedName`. I can kind of see why this

Weird interaction with public and non-public imports

2021-01-28 Thread SealabJaster via Digitalmars-d-learn
Please see: https://run.dlang.io/is/2mwcPH I'd expect that the `isInstanceOf` would be true instead of false here. Commenting out the public import changes the output of `fullyQualifiedName`. I can kind of see why this happens, but it's kind of annoying when things like `isInstanceOf`

[Issue 17436] Weird `cast(double) i != cast(double) i` on 32-bit hosts

2020-09-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17436 --- Comment #3 from kinke --- Ah sorry, that's for signed long only. --

[Issue 17436] Weird `cast(double) i != cast(double) i` on 32-bit hosts

2020-09-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17436 --- Comment #2 from kinke --- [The generated code uses the ucomisd instruction, which is SSE2, so using cvtsi2sd (SSE2) and avoiding the x87 should be feasible.] --

[Issue 17436] Weird `cast(double) i != cast(double) i` on 32-bit hosts

2020-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17436 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 17436] Weird `cast(double) i != cast(double) i` on 32-bit hosts

2020-08-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17436 Walter Bright changed: What|Removed |Added Keywords||backend CC|

[Issue 21123] ICE during toChars() of weird CommaExp lowering

2020-08-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 kinke changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 21123] ICE during toChars() of weird CommaExp lowering

2020-08-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 --- Comment #3 from kinke --- (In reply to kinke from comment #2) > Seems to be fixed indeed according to run.dlang.io. Well I've assumed the nightly build there was up-to-date, but it's some old v2.091 build (as is the Windows nightly download). -

[Issue 21123] ICE during toChars() of weird CommaExp lowering

2020-08-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 --- Comment #2 from kinke --- Seems to be fixed indeed according to run.dlang.io. I'd like to see this in the v2.093.1 point release though, as it would e.g. seriously impede LDC debugging (-vv output etc.) for upcoming v1.23. --

[Issue 21123] ICE during toChars() of weird CommaExp lowering

2020-08-09 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 RazvanN changed: What|Removed |Added CC||razvan.nitu1...@gmail.com --- Comment #1 from

[Issue 21123] ICE during toChars() of weird CommaExp lowering

2020-08-06 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 Walter Bright changed: What|Removed |Added Keywords||ice-on-valid-code CC|

[Issue 21123] New: ICE during toChars() of weird CommaExp lowering

2020-08-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21123 Issue ID: 21123 Summary: ICE during toChars() of weird CommaExp lowering Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: regression

[Issue 18831] Weird interaction between std.variant, std.algorithm.iteration.map, and alias this

2020-06-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18831 Paul Backus changed: What|Removed |Added Status|NEW |RESOLVED CC|

Re: Weird behavior with UDAs

2020-06-13 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 13 June 2020 at 13:08:29 UTC, realhet wrote: How can be a string represented with 'null' by default instead on `""`. Unless I state it explicitly with name="" ? o.O Because string is simply `alias string = immutable(char)[]`, and default initializer for arrays is null.

Re: Weird behavior with UDAs

2020-06-13 Thread realhet via Digitalmars-d-learn
On Saturday, 13 June 2020 at 12:55:36 UTC, realhet wrote: Hello, I have a problem I can't even understand with the code For the first I realized that an UDA can be a type too, and come up with this: template getUDA(alias a, U){ enum u = q{ getUDAs!(a, U)[$-1] }; static if(hasUDA!(a,

Re: Weird behavior with UDAs

2020-06-13 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 13 June 2020 at 12:55:36 UTC, realhet wrote: My first question is, how to avoid that error with A.i4? Why is there a difference between @UNIFORM and @UNIFORM(), do the first returns a type and the later returns a value? Basically yeah. a UDA in D is just whatever you write gets

Weird behavior with UDAs

2020-06-13 Thread realhet via Digitalmars-d-learn
Hello, I have a problem I can't even understand with the code below: https://run.dlang.io/is/7yXAEA import std.stdio, std.range, std.algorithm, std.traits, std.meta; struct UNIFORM{ string name; } struct A{ int i1; @UNIFORM() int i2; @UNIFORM("fuzz") int i3; @UNIFORM int i4;

[Issue 10110] Weird linker crashing

2020-04-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=10110 Mathias LANG changed: What|Removed |Added Status|NEW |RESOLVED CC|

[Issue 6318] module isn't fully processed under weird conditions

2020-03-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=6318 Basile-z changed: What|Removed |Added CC|b2.t...@gmx.com | --

[Issue 18303] Unqual gives weird results for const types

2020-03-20 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18303 Basile-z changed: What|Removed |Added CC|b2.t...@gmx.com | --

[Issue 15028] Weird disassembly on asm.dlang.org

2019-12-23 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15028 berni44 changed: What|Removed |Added Status|NEW |RESOLVED CC|

  1   2   3   4   5   6   7   >