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

Alternative fix for unused functions warnings on stb_truetype.h (and … #3237

Closed
wants to merge 1 commit into from
Closed

Conversation

ghost
Copy link

@ghost ghost commented Aug 10, 2023

…stb_image.h)

As mentioned on #3235, submiting this for consideration since it could be an alternative way to workaround the unused functions warnings on stb_truetype.h (and stb_image.h).

Adds a void unused_stb_truetype(void) at the end of stb_truetype.h (R4967-R5000) and void unused_stb_image(void) at the end of stb_image.h (R7761-R7767) with the list of unused functions.

Downsides:

  • Has to be readded when stb_truetype.h and stb_image are updated;
  • Has to be manually populated;
  • Can be a bit verbose if there are too many unused functions (like this case on stb_truetype.h).

Upsides:

  • Fairly benign (shouldn't interfere or affect in any way the libraries operation, nor return anything if ever called);
  • Fairly simple and contained (just a single function with the list of unused functions in the end of the file it directly relates to);
  • Platform agnostic;
  • Doesn't affect the building system;
  • Maintains the warnings active, which, IMHO, are helpful.

Since it's an alternative method, this PR also reverts #3235 (rtext.c L74-L77, L86-L88) (rtexture.c L141-L144, L154-L156, L165-L168, L174-L176).

Tested successfully on PLATFORM_DESKTOP on Linux (Linux Mint 21.1 x86_64) and PLATFORM_WEB.

I think @ashn-dot-dev solution is pretty good. Just submiting this because it looked like an option worth testing.

Edit: added line marks.

@ghost
Copy link
Author

ghost commented Aug 10, 2023

Closed in accordance with #3235 (comment).

@ghost ghost closed this Aug 10, 2023
@ghost ghost deleted the fix/unused_functions branch August 10, 2023 13:21
@raysan5
Copy link
Owner

raysan5 commented Aug 11, 2023

@ubkp thanks for the review and excuse the late response here.

This pull request was closed.
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

Successfully merging this pull request may close these issues.

1 participant