orangeduck / Corange

Pure C Game Engine
http://www.youtube.com/watch?v=482GxqTWXtA
Other
1.79k stars 199 forks source link

GCC 4.8.3 compile failure #13

Closed ColinGilbert closed 8 years ago

ColinGilbert commented 9 years ago
src/assets/config.c: In function ‘cfg_save_file’:
src/assets/config.c:75:8: error: trampoline generated for nested function ‘write_entry’ [-Werror=trampolines]
   void write_entry(void* x) {

Also fails on versions 4.7.3 and 4.9.2

orangeduck commented 9 years ago

Try 8d165b40d3081d8946e8665d5731ae488947fb54

ColinGilbert commented 9 years ago

Unfortunately, this breaks the build. Here is the error:

src/assets/config.c:70:25: error: ‘c’ undeclared (first use in this function)
   char* key = dict_find(c->entries, val);
                         ^
src/assets/config.c:70:25: note: each undeclared identifier is reported only once for each function it appears in
In file included from /usr/include/SDL2/SDL_audio.h:36:0,
                 from /usr/include/SDL2/SDL.h:71,
                 from ./include/cengine.h:29,
                 from ./include/assets/config.h:4,
                 from src/assets/config.c:1:
src/assets/config.c:72:15: error: ‘file’ undeclared (first use in this function)
   SDL_RWwrite(file, key, strlen(key), 1);
ColinGilbert commented 9 years ago

Followup, it also breaks under all the other GCC versions listed above.

orangeduck commented 9 years ago

The previous version might work with -fnested-functions enabled. Otherwise I'll look into it later as it requires some larger updates (I thought all the nested functions were removed from the codebase). It sounds like you can also just remove the -Werror flag and it might compile.

dave-kennedy commented 8 years ago

I can confirm that it compiles after removing the -Werror flag. The error becomes a warning.

orangeduck commented 8 years ago

:+1: