Comments (12)
Hi all,
I just wanted to add that this same warning has caused us some trouble as well in OpenUSD. If anyone has a fix already, it would be great to see that merged, or at least I could add it as a patch in my build.
Thanks!
from stb.
As far as I can tell, you have to enable this warning explicitly, or use -Wall
. We don't generally fix -Wall
-only warnings.
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 -Wall
are generally too numerous, too marginal, or too inconsistent.
from stb.
As far as I can tell, you have to enable this warning explicitly, or use
-Wall
. We don't generally fix-Wall
-only warnings.
--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
from stb.
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.
from stb.
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.
from stb.
No prob!
Remember you can do:
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Warray-bounds"
#include "stb_image_resize2.h"
#pragma GCC diagnostic pop
In the meantime...
from stb.
No prob!
Remember you can do:
#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #include "stb_image_resize2.h" #pragma GCC diagnostic pop
In the meantime...
That supression trick comes in handy. Thank you for the feedback. Cheers
from stb.
I just posted the next version that fixes this, but remember you can easily wrap the header to avoid this (see two messages above)...
from stb.
I just posted the next version that fixes this, but remember you can easily wrap the header to avoid this (see two messages above)...
Found your pull request. I'll keep my eyes out. THANK YOU !!!!
from stb.
I have merged Jeff's new version to the repo. Looking at the code I'm not sure that this fixes the warning, let me know if it doesn't and I'll reopen.
from stb.
from stb.
Related Issues (20)
- Long double support
- stb_truetype: GPOS advance always 0 (while GPOS and KERN tables exist), while KERN works fine
- stb_truetype: stbtt_GetCodepointHMetrics() outputs weird advanceWidth values after being called several times HOT 1
- stb_image_resize2: assert/crash on resizing 2x2 to 1x1 images with wrap HOT 5
- stb_image: loading of an invalid JPEG image succeeds
- problem in reading libraries HOT 1
- 16 bit PNG Support
- Out-of-bounds Memory Access in stb_image Library during GIF Image Processing
- possibly incorrect function signatures in stb_sprintf
- The output of `stbir_resize_uint8_linear` function is competely wrong HOT 3
- stb_truetype valgrind: invalid read of size 1 HOT 1
- shput never fills in "key" field HOT 7
- STBDS_FREE is used outside of STB_DS_IMPLEMENTATION causing custom implementation to be replaced by free(). HOT 1
- how to hmdel in iterate hashmap? HOT 7
- stb_image: Add support for gainmaps (`libultrahdr`) support to image loader HOT 2
- Characterizing crashes with respect to file size HOT 1
- Overflow error with gcc 14.1 and LTO HOT 18
- VS2022 stbir_resize_uint8 ERROR HOT 1
- Malloc return not checked in stbi_write_hdr_core
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stb.