Skip to content

C++: Use new getConvSpecString instead of getConvSpecOffset and substring#21702

Draft
jketema wants to merge 1 commit intogithub:mainfrom
jketema:conv-string
Draft

C++: Use new getConvSpecString instead of getConvSpecOffset and substring#21702
jketema wants to merge 1 commit intogithub:mainfrom
jketema:conv-string

Conversation

@jketema
Copy link
Copy Markdown
Contributor

@jketema jketema commented Apr 13, 2026

Should address glibc timeout in BMN DCA.

Two DCA experiments:

  • Traced one
  • BMN one, which uses the last known working nightly SHA-pair as a base.

Please ignore the Custom Sources DCA experiment(s).

@github-actions github-actions bot added the C++ label Apr 13, 2026
@jketema jketema changed the title C++: Use getConvSpecString instead of getConvSpecOffset and substring C++: Use new getConvSpecString instead of getConvSpecOffset and substring Apr 13, 2026
* Gets the nth conversion specifier string.
*/
private string getConvSpecString(int n) {
n >= 0 and result = "%" + this.getFormat().splitAt("%", n + 1)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like this, it's quite clean for what it accomplishes. 👍

fmt = this.getFormat() and
rst = fmt.substring(offset, fmt.length()) and
exists(string rst, string regexp |
rst = this.getConvSpecString(n) and
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

rst is an odd choice of name now, since it used to (presumably) mean "rest", as in "the rest of the string after this conversion specifier". Now it means "the string from this conversion specifier to the next" and I think it should be renamed to reflect that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I read it as result, but you might be right.

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