Skip to content

Conversation

danbev
Copy link
Member

@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
Member 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
Member 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
Member 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