FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

src: restrict MaybeStackBuffer string helpers to text types by anonrig · Pull Request #62564 · nodejs/node · GitHub

/ node Public

src: restrict MaybeStackBuffer string helpers to text types - #62564

Closed
anonrig wants to merge 1 commit into
nodejs:mainfrom
anonrig:yagiz/fix-macos-warning
Closed

src: restrict MaybeStackBuffer string helpers to text types#62564
anonrig wants to merge 1 commit into
nodejs:mainfrom
anonrig:yagiz/fix-macos-warning

Conversation

anonrig commented Apr 2, 2026

Copy link
Copy Markdown
Member

Limit MaybeStackBuffer::ToString() and ToStringView to textual element types so byte buffers do not instantiate std::basic_string[_view] on libc++.

This avoids the macOS/Xcode deprecation warning for char_traits<unsigned char> while preserving existing string helper behavior for text buffers. uint16_t buffers are mapped to char16_t for these conversions so UTF-16 call sites continue to work.

anonrig requested a review from addaleax April 2, 2026 16:39
nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Apr 2, 2026
Comment thread src/util.h

template <typename T>
using MaybeStackBufferStringType =
std::conditional_t<std::is_same_v<T, uint16_t>, char16_t, T>;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This should just be a concept

   template <typename T>
  concept MaybeStackBufferStringLike =
      std::is_same_v<T, char> || std::is_same_v<T, wchar_t> ||
      std::is_same_v<T, char8_t> || std::is_same_v<T, char16_t> ||
      std::is_same_v<T, char32_t> || std::is_same_v<T, uint16_t>;

// ...

template <MaybeStackBufferStringLike U = T,
        typename Char = MaybeStackBufferStringType<U>>

targos commented Apr 2, 2026
edited
Loading

Copy link
Copy Markdown
Member

Issue: #62506

There's a PR from a first time contributor at #62507

anonrig commented Apr 2, 2026

Copy link
Copy Markdown
Member Author

Issue: #62506

There's a PR from a first time contributor at #62507

I'll close. Let's get a new contributor!

anonrig closed this Apr 2, 2026

codecov Bot commented Apr 2, 2026
edited
Loading

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.70%. Comparing base (a9ac9b1) to head (69be72f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #62564   +/-   ##
=======================================
  Coverage   89.70%   89.70%           
=======================================
  Files         695      695           
  Lines      214213   214214    +1     
  Branches    41021    41024    +3     
=======================================
+ Hits       192167   192169    +2     
+ Misses      14113    14109    -4     
- Partials     7933     7936    +3     
Files with missing lines Coverage Δ
src/util.h 90.98% <100.00%> (+0.07%) ⬆️

... and 26 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL