Undefined references in Druntime for microcontrollers

2020-10-18 Thread Severin Teona via Digitalmars-d-learn
Hi guys, I have been trying to port the current druntime for microcontrollers (that very little RAM and flash memory). I have been using the 'ldc-build-runtime' tool and finally I managed to compile something that looks alright. The problem is that I compiled the druntime with the flag 'BUI

D function in a .d file calling printf refuses to link.

2020-10-18 Thread WhatMeWorry via Digitalmars-d-learn
module mydll; extern (C): import core.stdc.stdio : printf; export { int addSeven(int a, int b) { //printf("Hello from within my DLL"); return a+b+7; } } The above D code file compiles and links, no problems with C:\D\dmd2\samples\d\mydll>dmd -v -m64 mydll.d -L/DLL -L/

Re: Compiler is calling `_memset64` in betterC

2020-10-18 Thread Ferhat Kurtulmuş via Digitalmars-d-learn
On Sunday, 18 October 2020 at 17:05:01 UTC, Neto wrote: On Sunday, 18 October 2020 at 16:12:59 UTC, Paul Backus wrote: On Sunday, 18 October 2020 at 16:04:55 UTC, Koro wrote: I'm writing a 'betterC' program and the compiler is generating a call to '_memset64' if I have an array literal where t

Re: Compiler is calling `_memset64` in betterC

2020-10-18 Thread Neto via Digitalmars-d-learn
On Sunday, 18 October 2020 at 16:12:59 UTC, Paul Backus wrote: On Sunday, 18 October 2020 at 16:04:55 UTC, Koro wrote: I'm writing a 'betterC' program and the compiler is generating a call to '_memset64' if I have an array literal where the elements are the same. It's a known bug: https://is

Re: Compiler is calling `_memset64` in betterC

2020-10-18 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 18 October 2020 at 16:04:55 UTC, Koro wrote: I'm writing a 'betterC' program and the compiler is generating a call to '_memset64' if I have an array literal where the elements are the same. It's a known bug: https://issues.dlang.org/show_bug.cgi?id=17778 My guess is that the reaso

Compiler is calling `_memset64` in betterC

2020-10-18 Thread Koro via Digitalmars-d-learn
I'm writing a 'betterC' program and the compiler is generating a call to '_memset64' if I have an array literal where the elements are the same. ``` extern(C) void main() { f([1, 1]); } void f(scope immutable ulong[] a) {} ``` Running `dmd -betterC app.d` fails with: ``` /usr/lib64/g

Re: QuickSort on ranges

2020-10-18 Thread jerome via Digitalmars-d-learn
I posted some sum-up on my github. https://preview.tinyurl.com/y6sprdbq