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

vkcubepp: Fix implicit cast compiler warnings #1080

Merged
merged 1 commit into from
Feb 18, 2025

Conversation

gnoliyil
Copy link
Contributor

@gnoliyil gnoliyil commented Feb 16, 2025

  1. std::tolower() returns an int value. Implicit converting an int to a char may trigger compiler warnings (-Wconversion on gcc and clang).

This change adds an explicit cast to suppress the implicit conversion warnings.

  1. Previously we used assert(!"....") to show error messages. This does an implicit conversion from const char* to bool which triggers compiler warnings (-Wconversion).

This change replaces it with assert(false && "...") which doesn't trigger the warning.

Bug: https://fxbug.dev/378964821

@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1. std::tolower() returns an `int` value. Implicit converting an `int`
to a `char` may trigger compiler warnings (-Wconversion on gcc
and clang).

This change adds an explicit cast to suppress the implicit conversion
warnings.

2. Previously we used `assert(!"....")` to show error messages. This
does an implicit conversion from `const char*` to `bool` which
triggers compiler warnings (-Wconversion).

This change replaces it with `assert(false && "...")` which doesn't
trigger the warning.

Bug: https://fxbug.dev/378964821
Change-Id: I51be6858db558568619d0d2e6bc01a544d3459e4
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg
Copy link

Author gnoliyil not on autobuild list. Waiting for curator authorization before starting CI build.

@gnoliyil gnoliyil changed the title vkcubepp: Cast std::tolower return value to char vkcubepp: Fix implicit cast compiler warnings Feb 16, 2025
@charles-lunarg charles-lunarg merged commit 8a7c276 into KhronosGroup:main Feb 18, 2025
18 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