Skip to content

Conversation

@thomas-brunel
Copy link
Contributor

Passing the result of the system command directly to WEXITSTATUS treats it as a temporary value, which may lead to invalid memory access. By storing the result in a variable before calling the macro, we ensure that the variable's address is valid, preventing errors or warnings. Clang especially reports it as an error, preventing compilation.

Partially solves issue #250

…ariable

Passing the result of the system command directly to WEXITSTATUS treats
it as a temporary value, which may lead to invalid memory access. By
storing the result in a variable before calling the macro, we ensure
that the variable's address is valid, preventing errors or warnings.

Signed-off-by: Thomas BRUNEL <[email protected]>
Copy link
Owner

@c-jimenez c-jimenez left a comment

Choose a reason for hiding this comment

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

Thanks for the fix

@c-jimenez c-jimenez added the bug Something isn't working label Jun 12, 2025
@c-jimenez c-jimenez merged commit f217547 into c-jimenez:develop Jun 12, 2025
4 checks passed
@thomas-brunel thomas-brunel deleted the fix/wexitstatus-rvalue branch June 12, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants