[PR #2801] [MERGED] Changed string::assign to explicitly specify last argument #2800

Closed
opened 2026-03-04 02:07:20 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2801
Author: @ggtakec
Created: 2/11/2026
Status: Merged
Merged: 2/11/2026
Merged by: @gaul

Base: masterHead: fix/assign


📝 Commits (1)

  • 679307a Changed string::assign to explicitly specify last argument

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/cache_node.cpp (+1 -1)

📄 Description

Relevant Issue (if applicable)

https://github.com/s3fs-fuse/s3fs-fuse/issues/2772#issuecomment-3868137428

Details

In CentOS7 + devtools-7(gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)), the definition of std::string::assign is slightly different from other versions, causing the build to fail.
This is because there is no default value for n in std::string& assign(const std::string& str, size_type pos, size_type n=npos).
This can be avoided by specifying n explicitly. Alternatively, or we can use std::string& assign(const char* pstr, size_type pos).
(This PR fixes by the former.)

Of course, I didn't want to make this change for suppoting C++03, but this single fix allows us to continue building on CentOS7.
There's also the question of how long we'll support CentOS7, but I would like to make this fix for now.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/2801 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 2/11/2026 **Status:** ✅ Merged **Merged:** 2/11/2026 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix/assign` --- ### 📝 Commits (1) - [`679307a`](https://github.com/s3fs-fuse/s3fs-fuse/commit/679307ade679e8e01178f49db71212a3d6801fbe) Changed string::assign to explicitly specify last argument ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/cache_node.cpp` (+1 -1) </details> ### 📄 Description ### Relevant Issue (if applicable) https://github.com/s3fs-fuse/s3fs-fuse/issues/2772#issuecomment-3868137428 ### Details In CentOS7 + devtools-7(gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)), the definition of std::string::assign is slightly different from other versions, causing the build to fail. This is because there is no default value for `n` in `std::string& assign(const std::string& str, size_type pos, size_type n=npos)`. This can be avoided by specifying `n` explicitly. Alternatively, or we can use std::string& assign(const char* pstr, size_type pos). (This PR fixes by the former.) Of course, I didn't want to make this change for suppoting C++03, but this single fix allows us to continue building on CentOS7. There's also the question of how long we'll support CentOS7, but I would like to make this fix for now. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:07:20 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#2800
No description provided.