Strange segfault from SDL_FreeSurface

社会主义新天地 提交于 2019-12-02 04:18:59

Please rename your function

void close(SDL_Window **win, SDL_Surface **surf)

since close is a standard C library function.

markotikvic

I can confirm this. Same scenario. Even with -Wall and -Wextra the compiler did not spit out a redeclaration warning. Same for open().

I need an experts' opinion if this is a gcc bug.

  • Solution 1: declare your close() as a static function (e.g. static close()).
  • Solution 2: rename your close() function to something else (e.g. my_close_foo()).
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!