Skip to content

Fix compilation warning #9773

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking โ€œSign up for GitHubโ€, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 22, 2022
Merged

Fix compilation warning #9773

merged 1 commit into from
Oct 22, 2022

Conversation

b-viguier
Copy link
Contributor

Hi there ๐Ÿ‘‹ ๐Ÿ™‚
I noticed a new warning while compiling my extension on Linux/Ubuntu with php8.2 branch:

/path/php-8.2-debug/include/php/main/php_network.h:214:68: warning: unused parameter โ€˜setsizeโ€™ [-Wunused-parameter]
  214 | static inline bool _php_check_fd_setsize(php_socket_t *max_fd, int setsize)
      |                                                                ~~~~^~~~~~~

The function _php_check_fd_setsize has been introduced here: #9602
Depending of the platform (WIN32), one of the two input parameters is never used.
I didn't find any generic UNUSED() macro, then I directly added the code to prevent the warning, but feel free to suggest something better ๐Ÿ˜„

Thanks ๐Ÿ™‡

@b-viguier
Copy link
Contributor Author

โ„น๏ธ Failing test has been added 2 days ago, not sure if it's related to my PR
18fe337

@b-viguier b-viguier marked this pull request as ready for review October 18, 2022 13:54
Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Thank you! This looks good to me as is, but maybe @arnaud-lb has a better idea.

I wonder, though, whether this shouldn't target PHP-8.0, given that the function has been introduced only a few weeks ago.

Copy link
Member

@arnaud-lb arnaud-lb left a comment

Choose a reason for hiding this comment

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

Thank you @b-viguier!

As per @cmb69's comment, do you want to rebase on PHP-8.0?

@b-viguier b-viguier changed the base branch from master to PHP-8.0 October 21, 2022 12:48
@b-viguier
Copy link
Contributor Author

You're welcome ๐Ÿ˜Š
I didn't notice that the original PR was targeting PHP-8.0, so I rebased mine accordingly ๐Ÿ‘
Let me know if something else is needed ๐Ÿ™‚

@arnaud-lb arnaud-lb merged commit 9940970 into php:PHP-8.0 Oct 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants