Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2017 12:53 PM, Luís Marques wrote: On Monday, 10 July 2017 at 19:41:48 UTC, Walter Bright wrote: What is the goal/reason/rationale for making a 16 bit D target? - I program for MSP430 - I'm tired of C's limitation - LDC works with MSP430 Those are quite understandable goals. I'm

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Brad Roberts via Digitalmars-d
On 7/10/17 10:49 AM, Luís Marques via Digitalmars-d wrote: On Monday, 10 July 2017 at 17:32:01 UTC, Iain Buclaw wrote: The official stance is that we don't. There is just far too much baggage that gets piled in by default that makes it very hostile, however those of us who are capable of

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 19:41:48 UTC, Walter Bright wrote: What is the goal/reason/rationale for making a 16 bit D target? - I program for MSP430 - I'm tired of C's limitation - LDC works with MSP430

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Walter Bright via Digitalmars-d
On 7/10/2017 5:41 AM, Luís Marques wrote: for 16 bit targets Having developed C/C++ on 16 bit targets for a couple decades, I have some curmudgeonly perspective. 1. having __LINE__ as size_t is madness. If I was responsible for that, shame on me. 2. a 16 bit type for 16 bit targets is

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 18:03:27 UTC, Steven Schveighoffer wrote: I think it's reasonable to instrument druntime/phobos with line_t, and then libraries may or may not work with 16-bit (I wouldn't be surprised if most don't), but at least they will likely work for files less than 65k lines

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Steven Schveighoffer via Digitalmars-d
On 7/10/17 1:49 PM, Luís Marques wrote: On Monday, 10 July 2017 at 17:32:01 UTC, Iain Buclaw wrote: The official stance is that we don't. There is just far too much baggage that gets piled in by default that makes it very hostile, however those of us who are capable of doing so won't try to

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Luís Marques via Digitalmars-d
On Monday, 10 July 2017 at 17:32:01 UTC, Iain Buclaw wrote: The official stance is that we don't. There is just far too much baggage that gets piled in by default that makes it very hostile, however those of us who are capable of doing so won't try to stop you, and you have the likes of

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Iain Buclaw via Digitalmars-d
On 10 July 2017 at 17:56, Luís Marques via Digitalmars-d wrote: > On 10/07/2017 14:31, Jonathan M Davis via Digitalmars-d wrote: >> >> I didn't think that D supported 16-bit targets at all. Do ldc and/or gdc >> support 16-bit targets of some kind? > > > LDC accepts

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Luís Marques via Digitalmars-d
On 10/07/2017 14:31, Jonathan M Davis via Digitalmars-d wrote: I didn't think that D supported 16-bit targets at all. Do ldc and/or gdc support 16-bit targets of some kind? LDC accepts -mtriple=msp430 with some small tweaks. This issue arose as I as working on a proper implementation of those

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Jonathan M Davis via Digitalmars-d
On Monday, July 10, 2017 9:22:01 AM MDT Steven Schveighoffer via Digitalmars-d wrote: > On 7/10/17 8:41 AM, Luís Marques wrote: > > 1) Change `size_t line` to `int line`. The line is already 32 bits under > > the covers (and I don't see the need to change that). The only issue > > might be code

Re: size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Steven Schveighoffer via Digitalmars-d
On 7/10/17 8:41 AM, Luís Marques wrote: 1) Change `size_t line` to `int line`. The line is already 32 bits under the covers (and I don't see the need to change that). The only issue might be code breakage. Not might, will. All exception derivatives call super(msg, file, line), which won't

size_t.sizeof == 2 && __LINE__.sizeof == 4

2017-07-10 Thread Luís Marques via Digitalmars-d
Hello, We have a few cases where __LINE__ is assigned to a size_t. For instance: class Exception : Throwable { @nogc @safe pure nothrow this(string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null) { super(msg, file, line, next);