Skip to content

vkcubepp: Fix implicit cast compiler warnings#1080

Merged
charles-lunarg merged 1 commit intoKhronosGroup:mainfrom
gnoliyil:cast
Feb 18, 2025
Merged

vkcubepp: Fix implicit cast compiler warnings#1080
charles-lunarg merged 1 commit intoKhronosGroup:mainfrom
gnoliyil:cast

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