[PR #2066] [MERGED] Fixed a warning by compiling on fedora 37 #2327

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

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/2066
Author: @ggtakec
Created: 11/23/2022
Status: Merged
Merged: 11/23/2022
Merged by: @gaul

Base: masterHead: fix_bug


📝 Commits (1)

  • d942374 Fixed a warning by compiling on fedora 37

📊 Changes

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

View changed files

📝 src/s3fs_logger.cpp (+1 -2)

📄 Description

Relevant Issue (if applicable)

n/a

Details

In Fedora:37 the following warning was printed when compiling.
The logic is that after the close fails, the file descriptor that s3fs tried to close is accessed, so there should be no problem, but the warning can be eliminated by changing the description, so I fixed it.

s3fs_logger.cpp: In member function 'bool S3fsLog::LowSetLogfile(const char*)':
s3fs_logger.cpp:218:28: warning: pointer 'oldfp' may be used after 'int fclose(FILE*)' [-Wuse-after-free]
  218 |             S3fsLog::logfp = oldfp;
      |             ~~~~~~~~~~~~~~~^~~~~~~
s3fs_logger.cpp:216:32: note: call to 'int fclose(FILE*)' here
  216 |         if(oldfp && 0 != fclose(oldfp)){
      |                          ~~~~~~^~~~~~~

🔄 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/2066 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 11/23/2022 **Status:** ✅ Merged **Merged:** 11/23/2022 **Merged by:** [@gaul](https://github.com/gaul) **Base:** `master` ← **Head:** `fix_bug` --- ### 📝 Commits (1) - [`d942374`](https://github.com/s3fs-fuse/s3fs-fuse/commit/d942374d88055c7e33a8acb9389b27af884c8c37) Fixed a warning by compiling on fedora 37 ### 📊 Changes **1 file changed** (+1 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/s3fs_logger.cpp` (+1 -2) </details> ### 📄 Description ### Relevant Issue (if applicable) n/a ### Details In Fedora:37 the following warning was printed when compiling. The logic is that after the close fails, the file descriptor that s3fs tried to close is accessed, so there should be no problem, but the warning can be eliminated by changing the description, so I fixed it. ``` s3fs_logger.cpp: In member function 'bool S3fsLog::LowSetLogfile(const char*)': s3fs_logger.cpp:218:28: warning: pointer 'oldfp' may be used after 'int fclose(FILE*)' [-Wuse-after-free] 218 | S3fsLog::logfp = oldfp; | ~~~~~~~~~~~~~~~^~~~~~~ s3fs_logger.cpp:216:32: note: call to 'int fclose(FILE*)' here 216 | if(oldfp && 0 != fclose(oldfp)){ | ~~~~~~^~~~~~~ ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 02:04:57 +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#2327
No description provided.