Morale of a story: ~ is the right choice for concat operator

Patrick Schluter Patrick.Schluter at bbox.fr
Sat May 26 08:36:12 UTC 2018


On Friday, 25 May 2018 at 23:05:51 UTC, Jonathan M Davis wrote:
>
> Sure, it can be argued that this should be unnecessary and that 
> the programmer should just get it right, but it's not an 
> altogether uncommon bug to screw up case statements and 
> invadvertently fall through to the next one when you meant to 
> put a break or some other control statement there. Originally, 
> implicit fallthrough was perfectly legal in D just like it is 
> in C or C++. However, when it was made illegal, it caught quite 
> a few bugs in existing programs - including at companies using 
> D. This change to the language fixed bugs and almost certainly 
> saved people time and money.

and that the issue is real in C is also illustrated by the fact 
that gcc now warns about implicit fallthrough since version 7. 
One has to add at least a comment to suppress the warning (btw 
the implementation of the heuristic to analyse the comments is 
more or less broken, I had to file my first bug report to gcc 
about it).


More information about the Digitalmars-d mailing list