0

I encountered a function like this in this demo of the libomemo library:

int openssl_init(void ** state) {
  (void) state;

  // call another initialization function

  return 0;
}

I'm confused about the line (void) state;. I've seen similar lines of code all over the place, but I haven't been able to figure out what their purpose is. From what I understand about casts, that expression would return state converted to type void, but that value then goes unused.

Keith Thompson
  • 254,901
  • 44
  • 429
  • 631

0 Answers0