Skip to content

ggml : suppress Windows compiler warnings #3075

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 2 commits into from
Apr 29, 2025
Merged

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented Apr 25, 2025

This commit disables compiler warnings on window using MSVC.

The motivation for these changes is that some compilers generate
warnings for these conversion, for example Windows MSVC, and
there are quite a few of them. This makes it a little difficult to
spot new warnings that may be introduced and also can be difficult
for users/embedders of ggml where these warnings are hard to separate
from their own warnings.

@ggerganov
Copy link
Member

The main problem is that the type conversion warnings are difficult to track when they are enabled only for Windows. We should either enable these warning for other compilers/environments and fix them all or disable the warning from the Windows builds.

@slaren What do you think?

@danbev
Copy link
Collaborator Author

danbev commented Apr 25, 2025

The main problem is that the type conversion warnings are difficult to track when they are enabled only for Windows. We should either enable these warning for other compilers/environments and fix them all or disable the warning from the Windows builds.

Yeah, it is easy for them to sneak in as it is right now.

I've added another commit which suppresses the warnings in whisper.cpp and with that there are no warnings on windows when building. I was almost done with this so I wanted to complete it just in case we want to use it.

@slaren
Copy link
Member

slaren commented Apr 25, 2025

I think it would be better to disable the warning in MSVC in the cmake script, and remove all the #pragma warning that are present in many files to disable these warnings.

@danbev
Copy link
Collaborator Author

danbev commented Apr 26, 2025

think it would be better to disable the warning in MSVC in the cmake script, and remove all the #pragma warning that are present in many files to disable these warnings.

I'll try to take a look at this next week 👍

@danbev danbev marked this pull request as ready for review April 28, 2025 13:31
This commit disables compiler warnings on window using MSVC.

The motivation for these changes is that some compilers generate
warnings for these conversion, for example Windows MSVC, and
there are quite a few of them. This makes it a little difficult to
spot new warnings that may be introduced and also can be difficult
for users/embedders of ggml where these warnings are hard to separate
from their own warnings.
Copy link
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the ggml warnings should be disabled at the ggml-level CMakeLists.

@danbev
Copy link
Collaborator Author

danbev commented Apr 29, 2025

Maybe the ggml warnings should be disabled at the ggml-level CMakeLists.

Yeah, that makes more sense. I'll move those related to ggml 👍

Move ggml related warnings into ggml. This commit also fixes the
indentation and adds a missing whitespace to the if statement.
@danbev danbev requested a review from ggerganov April 29, 2025 12:07
@danbev danbev merged commit 55d73a1 into ggml-org:master Apr 29, 2025
52 checks passed
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