My Kingdom For ...
Don Clugston
dac at nospam.com.au
Fri Feb 22 13:27:34 PST 2008
Janice Caron wrote:
> On 22/02/2008, Derek Parnell <derek at nomail.afraid.org> wrote:
>> Compile with the "-w" switch. It checks for 'missing' return paths.
>
> Ah great! Thanks. That will help a lot.
>
> I thought D didn't have warnings, but obviously I was wrong.
>
> It's a shame you can't /selectively/ enable warnings, because I don't
> actually want to be warned about "length" shadowing. Still - it's
> better than it's being an error. In general, I'd prefer that /all/
> shadowing should be allowed. But that's another debate.
>
> Anyway, thanks for the info. Will definitely be using -w from now on.
Really, 'missing return value' should be an error, not a warning. Unfortunately
-w is horribly broken. It generates some nasty spurious errors. For example, it
won't let you perform a bitwise operation on anything other than an int.
short a;
short b = a | a; // won't compile with -w !!!!
More information about the Digitalmars-d
mailing list