You are a stupid programmer, you can't have that
Daniel N
no at public.email
Mon Aug 9 18:23:42 UTC 2021
On Monday, 9 August 2021 at 18:00:23 UTC, H. S. Teoh wrote:
> if (someCondition)
> doSomething();
> else
> doSomethingElse();
> return 1; // <--- bugfix
> finishUp();
>
> Had braces been required, the `return 1;` would have been
> introduced in the proper scope and there would have been no
> problem. But now this fix has introduced a new bug.
>
>
> T
The above code will fail to compile in recent C/C++ compilers,
because of suspected intentional backdoors hiding in plain sight
using this technique.
<source>:7:5: warning: this 'else' clause does not guard...
[-Wmisleading-indentation]
<source>:9:9: note: ...this statement, but the latter is
misleadingly indented as if it were
Thus there's no longer a good reason to avoid this style, unless
you are using a compiler where this is not yet implemented.
More information about the Digitalmars-d
mailing list