DIP(?) Warning to facilitate porting to other archs
Marco Leise via Digitalmars-d
digitalmars-d at puremagic.com
Sun Aug 31 14:28:05 PDT 2014
Am Sat, 03 May 2014 03:17:23 +0200
schrieb Jonathan M Davis via Digitalmars-d
<digitalmars-d at puremagic.com>:
> […]
>
> Putting warnings in the compiler always seems to result in forcing people to
> change their code to make the compiler shut up about something that is
> perfectly fine.
>
> - Jonathan M Davis
I agree with you about warnings about clarity of operator
precedence and the like, where it is just a matter of style.
But I don't see what that has to do with this issue and code
like:
size_t = ulong; // breaks when porting from 64 to 32 bit
uint = size_t; // breaks when porting from 32 to 64 bit
which is obviously broken, but accepted. I would really like
to force people to change their code to make the compiler shut
up. See some of the linked bugs for examples:
https://issues.dlang.org/show_bug.cgi?id=5063#c4
Now we have 3 bad options and no good one: :(
- add warnings to dmd, which should never have real warnings
and dozens of flags to control them
- make size_t a distinct type, which is unfeasible to implement
and is likely to break _something_
- keep the status quo with libraries that don't compile and
try to educate people about the issue
--
Marco
More information about the Digitalmars-d
mailing list