Skip to content

ADFA-3681 | Fix Llama C++ build warnings - #57

Open
jatezzz wants to merge 2 commits into
mainfrom
fix/ADFA-3681-remove-llama-build-warnings
Open

ADFA-3681 | Fix Llama C++ build warnings#57
jatezzz wants to merge 2 commits into
mainfrom
fix/ADFA-3681-remove-llama-build-warnings

Conversation

@jatezzz

@jatezzz jatezzz commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

Replaced the deprecated std::codecvt_utf8_utf16 and std::wstring_convert in the JNI string conversion with a custom UTF-8 to UTF-16 parser to eliminate build warnings during the :llama-impl build process. Additionally, corrected the artifact paths in the rebuild-llama-aar.sh script to ensure proper generation.

Details

The build logs will no longer display the -Wdeprecated-declarations warnings when compiling the llama-android.cpp native library.

image

Ticket

ADFA-3681

Observation

The custom UTF-8 to UTF-16 parser safely handles valid multi-byte sequences (including 4-byte emoji characters) and substitutes invalid bytes with ?, guaranteeing that a truncated or invalid sequence cannot corrupt the remainder of the string.

jatezzz added 2 commits July 31, 2026 10:33
The script copied to a nonexistent ai-core-plugin/libs/ instead of the libs/ paths build.gradle.kts declares. Also check build outputs exist before copying, so a failed build cannot leave stale artifacts.
std::wstring_convert is deprecated in C++17, removed in C++26. Decode UTF-8 to UTF-16 explicitly and keep env->NewString; NewStringUTF expects CESU-8 and would mangle emoji. Invalid input now degrades per-sequence.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

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.

2 participants