Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Unexpected behavior when using algorithm::trim() to remove spaces

Open
#58 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Start with algorithm::trim() and reproduce the comma-split example from boostorg/compute#817 using the Linux cross-compiler from the Android NDK. Compare its behavior with MSVC on Windows and GCC/Clang on macOS to isolate the platform-specific cause. Done means the cause is explained and the reported output is corrected without regressions.

Written by the indexing model from the issue text.

Description

The issue comes from boostorg/compute#817 where boost::trim() is invoked to sanitize OpenCL kernel arguments from preprocessor-generated strings. One of the failing cases taken directly from the boost compute repo is this:

two, pi          // original string   
[two, pi]        // vector after split() using comma as delimiter
two              // first element after trim()
 p               // second element after trim()

Here the trim() actually leave a leading space left of pi and slices one valid character on the right. One big BUT: this only happens to Linux cross-compiler targeting Android platform, downloaded from Android NDK page. Where as MSVC on Windows, GCC/Clang on Mac all run without problems. What might be the reason of this unexpected behavior?

Dominant language
C++
Stars
131
Forks
117
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/algorithm

All issues in boostorg/algorithm

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.