Error complaints being thrown up by compiler
Opened this issue · 4 comments
7dog123 commented
Here's what it's complaining about.
i_video.c:56:16: error: implicit declaration of function 'display_get'; did you mean 'display_init'? [-Werror=implicit-function-declaration]
56 | return display_get();
| ^~~~~~~~~~~
| display_init
i_video.c:56:16: error: returning 'int' from a function with return type 'surface_t *' {aka 'struct surface_s *'} makes pointer from integer without a cast [-Werror=int-conversion]
56 | return display_get();
| ^~~~~~~~~~~~~
i_video.c:60:16: error: implicit declaration of function 'display_try_get' [-Werror=implicit-function-declaration]
60 | return display_try_get();
| ^~~~~~~~~~~~~~~
i_video.c:60:16: error: returning 'int' from a function with return type 'surface_t *' {aka 'struct surface_s *'} makes pointer from integer without a cast [-Werror=int-conversion]
60 | return display_try_get();
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
thekovic commented
You need to be building with libdragon from the unstable branch https://github.com/DragonMinded/libdragon/wiki/Unstable-branch
7dog123 commented
@thekovic Alright I've done that just now and now it's complaining about another error in r_things.c
r_things.c:859:27: error: storing the address of local variable 'unsorted' in '*vissprite_p.150_7 + 4294967236.next' [-Werror=dangling-pointer=]
859 | (vissprite_p-1)->next = &unsorted;
| ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
r_things.c:841:25: note: 'unsorted' declared here
841 | vissprite_t unsorted;
| ^~~~~~~~
r_things.c:318:17: note: 'vissprite_p' declared here
318 | vissprite_t* vissprite_p;
| ^~~~~~~~~~~
r_things.c:857:24: error: storing the address of local variable 'unsorted' in 'vissprites[0].prev' [-Werror=dangling-pointer=]
857 | vissprites[0].prev = &unsorted;
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
r_things.c:841:25: note: 'unsorted' declared here
841 | vissprite_t unsorted;
| ^~~~~~~~
r_things.c:317:17: note: 'vissprites' declared here
317 | vissprite_t vissprites[MAXVISSPRITES];
| ^~~~~~~~~~
cc1: all warnings being treated as errors
jnmartin84 commented
Which verison of GCC are you on?
I haven't had time to build 13 yet, so I am still on 12 and this isn't an error on 12.
I guess I need to update my toolchain again but in the meantime you could take -Werror out of the Makefile and try again.
7dog123 commented
Sorry it tool so long to answer and yes, I'm building on 13
but I kinda used Chat GPT for the error and it came up with this the errors I'll put the fix up as a pull request