Skip to content

[BLD] Fix WSL build warning #28534

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
Jul 13, 2024
Merged

Conversation

scottshambaugh
Copy link
Contributor

@scottshambaugh scottshambaugh commented Jul 10, 2024

PR summary

A fresh build off the main branch was raising the following warning on WSL. This fixes that warning while keeping the behavior, and no warnings are raised during build now.

  [87/101] Compiling C++ object src/_image.cpython-312-x86_64-linux-gnu.so.p/_image_wrapper.cpp.o
  In file included from ../../src/_image_wrapper.cpp:4:
  ../../src/_image_resample.h: In instantiation of ‘struct is_grayscale<agg::rgba64, void>’:
  ../../src/_image_resample.h:509:11:   required from ‘struct type_mapping<agg::rgba64>’
  ../../src/_image_resample.h:708:11:   required from ‘void resample(const void*, int, int, void*, int, int, resample_params_t&) [with color_type = agg::rgba64]’
  ../../src/_image_wrapper.cpp:190:17:   required from here
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
    503 | template<typename T> struct is_grayscale<T, decltype(T::r, void())> : std::false_type {};
        |                                                         ~^~~~~~~~
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h: In instantiation of ‘struct is_grayscale<agg::rgba32, void>’:
  ../../src/_image_resample.h:509:11:   required from ‘struct type_mapping<agg::rgba32>’
  ../../src/_image_resample.h:708:11:   required from ‘void resample(const void*, int, int, void*, int, int, resample_params_t&) [with color_type = agg::rgba32]’
  ../../src/_image_wrapper.cpp:190:17:   required from here
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h: In instantiation of ‘struct is_grayscale<agg::rgba16, void>’:
  ../../src/_image_resample.h:509:11:   required from ‘struct type_mapping<agg::rgba16>’
  ../../src/_image_resample.h:708:11:   required from ‘void resample(const void*, int, int, void*, int, int, resample_params_t&) [with color_type = agg::rgba16]’
  ../../src/_image_wrapper.cpp:190:17:   required from here
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h: In instantiation of ‘struct is_grayscale<agg::rgba8T<agg::linear>, void>’:
  ../../src/_image_resample.h:509:11:   required from ‘struct type_mapping<agg::rgba8T<agg::linear> >’
  ../../src/_image_resample.h:708:11:   required from ‘void resample(const void*, int, int, void*, int, int, resample_params_t&) [with color_type = agg::rgba8T<agg::linear>]’
  ../../src/_image_wrapper.cpp:190:17:   required from here
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]
  ../../src/_image_resample.h:503:58: warning: left operand of comma operator has no effect [-Wunused-value]

PR checklist

@scottshambaugh scottshambaugh added this to the v3.9.2 milestone Jul 10, 2024
@scottshambaugh scottshambaugh marked this pull request as draft July 10, 2024 14:50
@scottshambaugh
Copy link
Contributor Author

Moving to draft, I want to investigate warnings on some of the other platforms as well.

@scottshambaugh scottshambaugh marked this pull request as ready for review July 11, 2024 01:19
@scottshambaugh
Copy link
Contributor Author

Not going to be able to work through warnings on other platforms, so just leaving as a small cleanup here. Looking at the CI builds, Windows could use a look to clean up some implicit type cast warnings.

@scottshambaugh scottshambaugh changed the title [BLD] Fix build warning [BLD] Fix WSL build warning Jul 11, 2024
@tacaswell tacaswell requested a review from anntzer July 11, 2024 18:21
@QuLogic
Copy link
Member

QuLogic commented Jul 13, 2024

I'm not sure this is specifically a WSL thing, but I can't remember where else I've seen these warnings.

@QuLogic QuLogic merged commit 6759849 into matplotlib:main Jul 13, 2024
54 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 13, 2024
QuLogic added a commit that referenced this pull request Jul 13, 2024
…534-on-v3.9.x

Backport PR #28534 on branch v3.9.x ([BLD] Fix WSL build warning)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants