What is the best practice from removing warnings when I don’t need to implement all the callback functions of a behavior ?
For instance:
Warning: undefined callback function code_change/3 (behaviour 'gen_event')
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The “best” practice is actually to implement stub callbacks, with sensible return values (such as
{reply, ok, State}for calls,{noreply, State}for casts and info etc.). This will also ensure stability and compatibility if someone would ever try a code upgrade, for example, on your code.There is no way to ignore these warnings currently.