Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

fix: ignored-attributes warning in CommandExecutor #2075

Closed
wants to merge 1 commit into from

Conversation

qnixsynapse
Copy link
Contributor

Describe Your Changes

-The warning was triggered by using decltype(&PCLOSE) to deduce the deleter type for the std::unique_ptr member m_pipe. While decltype(&PCLOSE) correctly deduces the function pointer type, the compiler flags this as a potential issue because attributes associated with the function pointer type (if any existed in the definition of PCLOSE) are ignored when used as a template argument.
To resolve this warning, the deleter type for std::unique_ptr is now explicitly specified as int (*)(FILE*). This directly states the function pointer type expected for PCLOSE and avoids the attribute deduction issue.

This is a code quality improvement and does not change the functionality of the CommandExecutor class. It only modifies the type declaration of the m_pipe member.

@qnixsynapse qnixsynapse requested a review from vansangpfiev March 6, 2025 14:13
@github-roushan
Copy link
Contributor

hey @qnixsynapse a PR for this already open Pr #2072

@qnixsynapse qnixsynapse closed this Mar 7, 2025
@qnixsynapse qnixsynapse mentioned this pull request Mar 7, 2025
3 tasks
@qnixsynapse qnixsynapse deleted the fix/warning_ignore_attributes branch March 7, 2025 02:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants