Strange segfault from SDL_FreeSurface

后端 未结 2 1527
清歌不尽
清歌不尽 2021-01-24 04:48

I have the following simple SDL code:

#include 
#include 
#include 

// helpers

bool init(SDL_Window **win, SDL_Sur         


        
2条回答
  •  庸人自扰
    2021-01-24 05:19

    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()).

提交回复
热议问题