Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Why do functions in mongoose-s end with void cast of parameters?

I'm not a C programmer (Ich spreche Java), and using Google results in no hits or a zillion hits, so I'll just ask.

Why do many of the callbacks reference the void arguments at the end of the code? For example, the example callback for MGOS_EVENT_TIME_CHANGED has the (void) ev and (void) arg references at the end.

static void my_time_change_cb(int ev, void *evd, void *arg) {
   struct mgos_time_changed_arg *ev_data = (struct mgos_time_changed_arg *) evd;
   LOG(LL_INFO, ("Time has changed by %d", ev_data->delta));

   (void) ev;
   (void) arg;
}
Sign In or Register to comment.