Skip to content

build: remove -Wno-pointer-sign and fix resulting warnings - #18317

Closed
YoussefZidan-1 wants to merge 14 commits into
mpv-player:masterfrom
YoussefZidan-1:fix-compiler-warnings
Closed

build: remove -Wno-pointer-sign and fix resulting warnings#18317
YoussefZidan-1 wants to merge 14 commits into
mpv-player:masterfrom
YoussefZidan-1:fix-compiler-warnings

Conversation

@YoussefZidan-1

Copy link
Copy Markdown

Relates to #13608

Removes -Wno-pointer-sign from meson.build and resolves all pointer sign compiler warnings across C source files.

@YoussefZidan-1
YoussefZidan-1 force-pushed the fix-compiler-warnings branch 8 times, most recently from 4f66f6f to d39abbe Compare July 29, 2026 20:28
@llyyr

llyyr commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Could you compile and test your changes locally before pushing? Running the whole CI suite just to fix one warning at a time isn't time or energy efficient for anyone.

@YoussefZidan-1

Copy link
Copy Markdown
Author

@llyyr Apologies for the CI spam! I'm pretty new to open source and still learning the workflow.

I ran into an issue where optional dependencies (subrandr, Vulkan display headers, etc.) weren't installed on my Linux system, so Meson silently skipped compiling those files locally, causing warnings to only surface when CI ran. Also, since I'm on Linux, the Windows (MSYS2/MinGW) and FreeBSD platform files weren't being compiled on my machine either.

I've reconfigured my local environment with Clang and -Dwerror=true, and I'm inspecting the remaining platform-specific files now so I don't trigger unnecessary CI runs. Thanks for your patience with a beginner!

@llyyr

llyyr commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

You can look at meson.options and enable as many dependencies as possible so you don't miss any. You can also cross compile for Windows https://github.com/mpv-player/mpv/blob/master/DOCS/compile-windows.md

@kasper93

Copy link
Copy Markdown
Member

Also if it is too much pain to fix all those warnings, it may not be worth it. Some warnings are really verbose.

@YoussefZidan-1

Copy link
Copy Markdown
Author

@kasper93 Thanks for the reassurance! I really appreciate it. I've fixed almost all of them across the core codebase, so I'm polishing up my current changes to leave everything in a clean state.

@llyyr Thank you for pointing out meson.options and the Windows compile documentation! That's super helpful. I've reconfigured my local build with Clang and enabled the additional options locally to test my fixes properly.

@YoussefZidan-1
YoussefZidan-1 force-pushed the fix-compiler-warnings branch 5 times, most recently from e71515b to 4adb7c1 Compare July 30, 2026 14:37
@YoussefZidan-1

Copy link
Copy Markdown
Author

Closing this PR after further consideration. Removing -Wno-pointer-sign requires too much explicit cast churn across 60+ files without changing binary output or runtime safety. Thanks @kasper93 and @llyyr for the feedback and guidance!

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.

3 participants