Forbid needless pointer casts
kindouchoud
jeyak10528 at ailiking.com
Sun Dec 27 18:06:53 UTC 2020
On Friday, 25 December 2020 at 15:16:04 UTC, kindouchoud wrote:
> On Thursday, 20 February 2020 at 11:31:17 UTC, FlameInHeart
> wrote:
>> Hey,
>>
>> How about forbidding this:https://1921681001.id/ ,
>> https://19216811.cam/ , https://jpgtopdf.onl/
>>
>> void foo(Monkey* m) {
>> Monkey* m2 = cast(Monkey*) m;
>> }
>>
>> Pointer casts are potentially nasty when refactoring and the
>> needless ones are easy for the compiler to detect, and
>> probably no-one will find objections to this change.
>>
>> Just an easy win, isn't it?
>>
>> (not going to write a DIP for this...)
>
> Truly, this change would unnecessarily muddle some format code.
> Composing a lot of additional rationale just to keep a format
> from emanating innocuous no-operation code in certain
> conditions is really excruciating by and by.
okey man
More information about the Digitalmars-d
mailing list