Content-Length: 318380 | pFad | https://github.com/nghttp2/nghttp2/pull/2387

FB Declare hex_to_uint_tbl constinit by tatsuhiro-t · Pull Request #2387 · nghttp2/nghttp2 · GitHub
Skip to content

Declare hex_to_uint_tbl constinit#2387

Merged
tatsuhiro-t merged 1 commit intomasterfrom
constinit
May 19, 2025
Merged

Declare hex_to_uint_tbl constinit#2387
tatsuhiro-t merged 1 commit intomasterfrom
constinit

Conversation

@tatsuhiro-t
Copy link
Member

No description provided.

@tatsuhiro-t tatsuhiro-t added this to the v1.66.0 milestone May 19, 2025
@tatsuhiro-t tatsuhiro-t requested a review from Copilot May 19, 2025 09:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the hex_to_uint_tbl declaration to use C++20’s constinit specifier for guaranteed initialization timing.

  • Switches from static constexpr to constinit const auto on hex_to_uint_tbl
  • Aims to enforce initialization at program startup rather than rely on dynamic/static initialization order

bool in_attr_char(char c);

static constexpr auto hex_to_uint_tbl = []() {
constinit const auto hex_to_uint_tbl = []() {
Copy link

Copilot AI May 19, 2025

Choose a reason for hiding this comment

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

Without inline or static, this header-defined variable has external linkage and can violate the One Definition Rule when included in multiple translation units. Consider adding inline (e.g., inline constinit const auto) or restoring static to maintain internal linkage.

Suggested change
constinit const auto hex_to_uint_tbl = []() {
inline constinit const auto hex_to_uint_tbl = []() {

Copilot uses AI. Check for mistakes.
@tatsuhiro-t tatsuhiro-t merged commit dd29308 into master May 19, 2025
87 checks passed
@tatsuhiro-t tatsuhiro-t deleted the constinit branch May 19, 2025 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants









ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/nghttp2/nghttp2/pull/2387

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy