0

I discovered in the SDL2 sources something weird.

while (renderer->textures) {
    SDL_Texture *tex = renderer->textures; (void) tex;
    SDL_DestroyTexture(renderer->textures);
    SDL_assert(tex != renderer->textures);  /* satisfy static analysis. */
}

The loop itself is just a linked list iteration (SDL_DestroyTexturemodifies renderer->textures). But there is (void) tex; which I don't understand : it seems like a cast to void, but what is the objective ? tex is just a pointer so there is no need to evaluate it, and the return value of the cast isn't stored (if storing void is even possible ...).

Thanks for anyone helping !

Julien Vernay
  • 275
  • 2
  • 13

0 Answers0