Skip to content
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

tests : add _CRT_SECURE_NO_WARNINGS for WIN32 #8231

Merged

Conversation

danbev
Copy link
Collaborator

@danbev danbev commented Jul 1, 2024

This commit adds the compile definition _CRT_SECURE_NO_WARNINGS to the root cmake subproject.

The motivation for this is that currently the following warnings are displayed when compiling the tests and common cmake subprojects:

test-llama-grammar.cpp
C:\llama.cpp\src\.\llama.cpp(1406,77): warning C4996: 'strerror':
This function or variable may be unsafe. Consider using strerror_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See
online help for details.
[C:\llama.cpp\build\tests\test-llama-grammar.vcxproj]
...

This compile definition is currently set for the src subproject and this change moves into the root cmake project so that it is applied to all cmake subprojects.

This commit adds the compile definition `_CRT_SECURE_NO_WARNINGS`
to the root cmake subproject.

The motivation for this is that currently the following warnings are
displayed when compiling the tests and common cmake subprojects:
```console
test-llama-grammar.cpp
C:\llama.cpp\src\.\llama.cpp(1406,77): warning C4996: 'strerror':
This function or variable may be unsafe. Consider using strerror_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See
online help for details.
[C:\llama.cpp\build\tests\test-llama-grammar.vcxproj]
...
```

This compile definition is currently set for the `src` subproject
and this change moves into the root cmake project so that it is applied
to all cmake subprojects.
@github-actions github-actions bot added the build Compilation issues label Jul 1, 2024
@mofosyne mofosyne added the Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix label Jul 3, 2024
@danbev
Copy link
Collaborator Author

danbev commented Jul 4, 2024

The motivation for this PR is that currently there are quite a few warnings being generate on Windows which makes it difficult to identify if warnings are coming from llama.cpp, or from our own code. The end goal would be to get this down to zero warnings if possible.

Copy link
Owner

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

Not sure what this flag does, but I guess it's ok to move it to the root of the project

@ggerganov ggerganov merged commit f8c4c07 into ggerganov:master Jul 4, 2024
53 checks passed
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Jul 7, 2024
This commit adds the compile definition `_CRT_SECURE_NO_WARNINGS`
to the root cmake subproject.

The motivation for this is that currently the following warnings are
displayed when compiling the tests and common cmake subprojects:
```console
test-llama-grammar.cpp
C:\llama.cpp\src\.\llama.cpp(1406,77): warning C4996: 'strerror':
This function or variable may be unsafe. Consider using strerror_s
instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See
online help for details.
[C:\llama.cpp\build\tests\test-llama-grammar.vcxproj]
...
```

This compile definition is currently set for the `src` subproject
and this change moves into the root cmake project so that it is applied
to all cmake subprojects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Compilation issues Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants