Untested return values.

Lionello Lunesu lio at lunesu.remove.com
Tue Oct 3 05:58:24 PDT 2006


What would happen if DMD would issue a compiler warning for untested 
return values?

bool somefunc() { ... }

void main() {
   somefunc();//warning: untested return value
   auto b = somefunc();//OK
}

Especially useful for C or OS functions returning error values or handles.

L.

PS. might even be worth a compiler error.



More information about the Digitalmars-d mailing list