Giter Club home page Giter Club logo

Comments (12)

tcauchois avatar tcauchois commented on June 9, 2024 1

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.

nothings avatar nothings commented on June 9, 2024

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.

ThatOSDev avatar ThatOSDev commented on June 9, 2024

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.

jeffrbig2 avatar jeffrbig2 commented on June 9, 2024

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.

ThatOSDev avatar ThatOSDev commented on June 9, 2024

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.

jeffrbig2 avatar jeffrbig2 commented on June 9, 2024

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.

ThatOSDev avatar ThatOSDev commented on June 9, 2024

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.

jeffrbig2 avatar jeffrbig2 commented on June 9, 2024

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.

ThatOSDev avatar ThatOSDev commented on June 9, 2024

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.

nothings avatar nothings commented on June 9, 2024

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.

jeffrbig2 avatar jeffrbig2 commented on June 9, 2024

from stb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.