Open 1vanK opened 1 month ago
GCC 13, Clang 16, MinGW with -Wall -Wextra -Wpedantic
-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
Duplicate of https://github.com/nothings/stb/issues/1099
Use any method, and then spend another 10 years choosing the ideal one.
GCC 13, Clang 16, MinGW with
-Wall -Wextra -Wpedantic
https://stackoverflow.com/questions/6891720/initialize-reset-struct-to-zero-null