Skip to content

fix: silence clang warnings in stb_image_resize.h - #1889

Open
vmobilis wants to merge 1 commit into
leejet:masterfrom
vmobilis:patch-3
Open

fix: silence clang warnings in stb_image_resize.h#1889
vmobilis wants to merge 1 commit into
leejet:masterfrom
vmobilis:patch-3

Conversation

@vmobilis

Copy link
Copy Markdown
Contributor

Summary

Clang complains about unused expressions:

stb_image_resize.h:2390:90: warning: expression result unused [-Wunused-value]
 2390 |         STBIR__DEBUG_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes);
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
35 warnings generated.

Related Issue / Discussion

#614

Additional Information

When STBIR_DEBUG is not defined, STBIR__DEBUG_ASSERT is set to "", which causes STBIR__DEBUG_ASSERT(...) to be expanded as (...) – to unused expression.

Adding STBIR__DEBUG_ASSERT(x) blanks the whole assertion.

Or please update https://github.com/nothings/stb/blob/master/deprecated/stb_image_resize.h to version 0.97.
It seems to be stable enough and author replaced debug assertions with regular ones.
(But he changed the license in 0.97).

Checklist

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