Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error complaints being thrown up by compiler #31

Open
7dog123 opened this issue May 20, 2023 · 4 comments
Open

Error complaints being thrown up by compiler #31

7dog123 opened this issue May 20, 2023 · 4 comments

Comments

@7dog123
Copy link
Contributor

7dog123 commented May 20, 2023

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
Copy link
Contributor

You need to be building with libdragon from the unstable branch https://github.com/DragonMinded/libdragon/wiki/Unstable-branch

@7dog123 7dog123 changed the title Getting complaints about i_video.c Error complaints being thrown up by compiler May 20, 2023
@7dog123
Copy link
Contributor Author

7dog123 commented May 20, 2023

@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
Copy link
Owner

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
Copy link
Contributor Author

7dog123 commented May 21, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants