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

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 06:31:12 PDT 2017


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 breakage.
>
> Not might, will. All exception derivatives call super(msg, file, line),
> which won't work if your exception defines its ctor with size_t line =
> __LINE__.
>
> > 2) Make __LINE__ 16-bit for 16-bit targets. I don't think this option
> > makes much sense.

I didn't think that D supported 16-bit targets at all. Do ldc and/or gdc
support 16-bit targets of some kind?

- Jonathan M Davis




More information about the Digitalmars-d mailing list