I am using the ‘g_timeout_add_seconds’ in my code. But when i compile the following error is shown
warning: passing argument 2 of ‘g_timeout_add_seconds’
g_timeout_add_seconds(1, message_cb, data); //usage
gboolean message_cb(List *data) //prototype
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.
Don’t get rid of the warning – fix it.
The second parameter of
g_timeout_add_secondsis a function pointer (GSourceFunc) as follows:and
gpointeris a pointer tovoidIt’s not keen on you usingList* datainstead.Stick to the prototype and if you are passing a
List*then cast it within the callback.