Enforcing checks for return code

Chris Katko via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 17 23:21:05 PST 2016


Hello. I'm almost brand-new to the D language and still absorbing 
things.

I'm wondering if it's possible to fire off a compile-time (or 
worst case, a run-time) warning or error if a function is called, 
but the return value is not checked.

I'm not trying to enforce whether someone actually deciphers the 
value's meaning correctly. I just want to enforce that somewhere, 
a variable or expression is receiving the return value of a 
particular function.

Any ideas?

I imagine I could use a compiler flag to warn, but that's a 
global setting. I'm looking more for a specified subset of 
functions.


More information about the Digitalmars-d-learn mailing list