Skip to content

Silence a clang warning #4128

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

Merged
merged 1 commit into from
Aug 29, 2024
Merged

Conversation

kleisauke
Copy link
Member

Details
[371/416] Compiling C object tools/vipsheader.p/vipsheader.c.o
../tools/vipsheader.c:229:8: warning: variable 'image' is used uninitialized whenever '||' condition is true [-Wsometimes-uninitialized]
  229 |                         if (!(source = vips_source_new_from_descriptor(0)) ||
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tools/vipsheader.c:241:7: note: uninitialized use occurs here
  241 |                 if (image &&
      |                     ^~~~~
../tools/vipsheader.c:229:8: note: remove the '||' if its condition is always false
  229 |                         if (!(source = vips_source_new_from_descriptor(0)) ||
      |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../tools/vipsheader.c:221:19: note: initialize the variable 'image' to silence this warning
  221 |                 VipsImage *image;
      |                                 ^
      |                                  = NULL
1 warning generated.

Targets the 8.15 branch in case someone compiles with -Werror.

@kleisauke
Copy link
Member Author

macOS CI failures is likely due to commit ImageMagick/ImageMagick@f0357c7 which was probably fixed with commit ImageMagick/ImageMagick@18377f9.

@jcupitt jcupitt merged commit d622bc8 into libvips:8.15 Aug 29, 2024
5 of 6 checks passed
@kleisauke kleisauke deleted the 8.15-silence-clang-warn branch August 29, 2024 11:45
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.

2 participants