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

[KDESKTOP-1129] Enables new compilation warnings with a view to sanitize code #306

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

luc-guyot-infomaniak
Copy link
Contributor

@luc-guyot-infomaniak luc-guyot-infomaniak commented Sep 19, 2024

As a first step toward a zero warning policy as depicted in KDESKTOP-1129, these changes enable a series of compilation warnings that will help sanitize code and increase runtime safety.

@luc-guyot-infomaniak luc-guyot-infomaniak changed the title Enables new compilation warnings with a view to sanitize code [KDESKTOP-1129] Enables new compilation warnings with a view to sanitize code Sep 19, 2024
@luc-guyot-infomaniak luc-guyot-infomaniak marked this pull request as ready for review September 19, 2024 11:52
@luc-guyot-infomaniak luc-guyot-infomaniak requested a review from a team as a code owner September 19, 2024 11:52

std::vector<char> cstr(maxUtf8Bytes, '\0');
auto result = CFStringGetCString(cfstring, cstr.data(), cstr.size(), kCFStringEncodingUTF8);
std::vector<char> cstr(static_cast<size_t>(maxUtf8Bytes), '\0');
Copy link
Contributor Author

@luc-guyot-infomaniak luc-guyot-infomaniak Sep 19, 2024

Choose a reason for hiding this comment

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

This cast is now required for the compilation to succeeds.

@luc-guyot-infomaniak luc-guyot-infomaniak marked this pull request as draft September 19, 2024 11:58
@herve-er herve-er added the 4.0.0 label Sep 20, 2024
@herve-er herve-er added 3.6.7 and removed 4.0.0 labels Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants