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
Array Out Of Bounds - stb_image_resize2.h #1616
Comments
As far as I can tell, you have to enable this warning explicitly, or use Because you're meant to compile the project into your source code with your own compiler settings, we do try to eliminate warnings in general, but warnings from |
--SNIP-- I should have added my settings... Here is what I use in my makefile. CFLAGS=-Wall -Werror -std=c17 -m64 -O2 From what I am seeing, the function is trying to run math on an array table "fp32_to_srgb8_tab4". And this is why it's showing an Out Of Bounds warning. I did succeed in removing the warning once, when I removed the const pointer. (I'm overly simplifying how I did it, but you get the idea.) However, I'm not sure if that was the right thing to do. Either way, I was told to mention this warning here from the raylib discord, since raylib 5.0 is using the stb_image_resize2.h header file. In raylib 4.x it was using the first iteration "stb_image_resize.h". It was fine with no errors. But version 2 seems to have a lot of issues. I only listed just one of them here on this thread. I'll post if I find a fix for this. Thanks for replying. Cheers |
I can post a fix for this one - like Sean said we don't normally worry about -Wall, but I can tweak the code easily enough to avoid the GCC warning easily enough. It does not read outside the buffer, of course - it's just an, in this case, unhelpful warning. |
That would be great Jeff. Thank you. Side Note : If this was one or two warnings, I wouldn't bother you all with it. But this spams 144 Warnings all for that same thing. So the Fix will be MUCH appreciated. Cheers. |
No prob! Remember you can do: #pragma GCC diagnostic push In the meantime... |
That supression trick comes in handy. Thank you for the feedback. Cheers |
Describe the bug
Lines 8510, 8611, and 8702 show the same code used, and each line causes an Out Of Bounds warning in GCC 11.2.
The filename is stb_image_resize2.h
GCC 11.2 with c17.
It will SPAM you with the same array warning for each one of the three lines listed above. This below is just one of hundreds of spam-like examples of the warning.
I edited the beginning of the path to libs / raylib to keep it simpler to read. However, this is not about raylib, but about the warning generated from stb_image_resize2.h.
SIDE NOTE : I have tested this in the new raylib 5.0. It's using the same file (stb_image_resize2.h) from the original stb github. So you can easily reproduce this warning by compiling the raylib code if that makes it easier to spot. The warning always comes from those lines in stb_image_resize2.h.
The text was updated successfully, but these errors were encountered: