nothings / stb

stb single-file public domain libraries for C/C++
https://twitter.com/nothings
Other
25.9k stars 7.66k forks source link

stb_image_resize: warning: comparison between signed and unsigned integer expressions #1483

Open jasonrohrer opened 1 year ago

jasonrohrer commented 1 year ago

I noticed these warnings today when compiling with g++ on a very old (10.5) version of MacOS.

I haven't seen similar warnings on Linux or Windows, and I haven't looked into the details of where the warnings are coming from.

But I thought I should log it here, just for future reference.

stb_image_resize.h: In function ‘int stbir__get_filter_pixel_width(stbir_filter, float)’:
stb_image_resize.h:886: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h: In function ‘stbir_uint32 stbir__calculate_memory(stbir__info*)’:
stb_image_resize.h:2270: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h:2272: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h: In function ‘int stbir__resize_allocated(stbir__info*, const void*, int, void*, int, int, stbir_uint32, stbir_datatype, stbir_edge, stbir_edge, stbir_colorspace, void*, size_t)’:
stb_image_resize.h:2322: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h:2323: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h:2325: warning: comparison between signed and unsigned integer expressions
stb_image_resize.h:2327: warning: comparison between signed and unsigned integer expressions
nothings commented 1 year ago

We're very close to releasing a significantly revised version of stb_image_resize, so it may or may not have the same issues.