Skip to content
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

stb_image_write.h warnings #1709

Open
1vanK opened this issue Oct 19, 2024 · 2 comments
Open

stb_image_write.h warnings #1709

1vanK opened this issue Oct 19, 2024 · 2 comments

Comments

@1vanK
Copy link

1vanK commented Oct 19, 2024

GCC 13, Clang 16, MinGW with -Wall -Wextra -Wpedantic

/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_bmp_to_func(void (*)(void*, void*, int), void*, int, int, int, const void*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:514:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  514 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:514:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:514:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_bmp(const char*, int, int, int, const void*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:522:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  522 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:522:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:522:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_tga_to_func(void (*)(void*, void*, int), void*, int, int, int, const void*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:613:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  613 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:613:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:613:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_tga(const char*, int, int, int, const void*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:621:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  621 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:621:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:621:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_hdr_to_func(void (*)(void*, void*, int), void*, int, int, int, const float*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:789:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  789 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:789:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:789:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_hdr(const char*, int, int, int, const float*)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:796:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
  796 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:796:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:796:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_jpg_to_func(void (*)(void*, void*, int), void*, int, int, int, const void*, int)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1609:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
 1609 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1609:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1609:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h: In function ‘int stbi_write_jpg(const char*, int, int, int, const void*, int)’:
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1618:32: warning: missing initializer for member ‘stbi__write_context::context’ [-Wmissing-field-initializers]
 1618 |    stbi__write_context s = { 0 };
      |                                ^
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1618:32: warning: missing initializer for member ‘stbi__write_context::buffer’ [-Wmissing-field-initializers]
/home/runner/work/dviglo2d/dviglo2d/engine_repo/libs/third_party/stb/repo/stb_image_write.h:1618:32: warning: missing initializer for member ‘stbi__write_context::buf_used’ [-Wmissing-field-initializers]

https://stackoverflow.com/questions/6891720/initialize-reset-struct-to-zero-null

@N-R-K
Copy link

N-R-K commented Oct 20, 2024

Duplicate of #1099

@1vanK
Copy link
Author

1vanK commented Oct 20, 2024

Use any method, and then spend another 10 years choosing the ideal one.

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

No branches or pull requests

2 participants