Skip to content

Promote warnings to Errors in sockets's extension. - #5075

Merged
php-pulls merged 1 commit into
php:masterfrom
Girgias:sockets-warnings-to-errors
Apr 21, 2020
Merged

Promote warnings to Errors in sockets's extension.#5075
php-pulls merged 1 commit into
php:masterfrom
Girgias:sockets-warnings-to-errors

Conversation

@Girgias

Copy link
Copy Markdown
Member

There are a bunch of expected array warnings, a better way is too probably ask for a HashTable param instead of a zval.

@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 82e81d3 to c3c5bf0CompareJanuary 11, 2020 00:16
@Girgias
Girgias marked this pull request as ready for review January 11, 2020 03:32
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from f88a4f8 to 650aa93CompareJanuary 24, 2020 12:02
@Girgias
Girgias requested a review from nikicJanuary 27, 2020 11:45
Comment threadext/sockets/conversions.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Convert this to ZEND_ASSERT(descr->from_zval), doesn't seem like it can be hit.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like you converted the wrong condition to an assert here...

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Uhhhh, what was I thinking >_>

Comment threadext/sockets/conversions.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These has_error checks are no longer going to work after some of your changes.

@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 650aa93 to 9d7c7f4CompareFebruary 4, 2020 22:18
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 9d7c7f4 to a336c3cCompareFebruary 25, 2020 11:00
@Girgias
Girgias requested a review from nikicFebruary 25, 2020 11:00
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from a336c3c to 33dbfa2CompareFebruary 26, 2020 02:21
@Girgias

Copy link
Copy Markdown
MemberAuthor

Test failures are FPM related ...

@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch 2 times, most recently from 3bffe06 to 5e745c7CompareMarch 27, 2020 01:32
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 5e745c7 to 99045d8CompareApril 5, 2020 19:44
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch 2 times, most recently from 9eb8684 to 8a1a9eaCompareApril 17, 2020 16:41
@Girgias

Copy link
Copy Markdown
MemberAuthor

I ignored a large part of warnings in multicast.c currently. Will maybe tackle them later or in a separate PR.

@Girgias

Copy link
Copy Markdown
MemberAuthor

@kocsismate I've updated most of the errors to use the new API, mind checking that I'm using the "standard" error format everywhere?

@kocsismatekocsismate left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I had a first look :) If you address the comments, please check for duplicates, because I saw that most of the messages are repeated (and I didn't comment everywhere).

Comment threadext/sockets/conversions.c Outdated
Comment threadext/sockets/sendrecvmsg.c Outdated
Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I used an argument_value_error with a message similar to must be specified for the AF_INET6 socket type in a similar situation

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Hum, maybe? It feels like a count error is more appropriate as there is a missing argument, but could change it to a ValueError.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My reasoning is that because this parameter is optional, and since it should be nullable in reality (and it will be when I start fixing optional params with UNKNOWN default values in stubs), we should think about this error that the default value is not appropriate in case of the aforementioned socket type. At least this is what I think 😊

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agree with @kocsismate.

Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated
Comment threadext/sockets/sockets.c Outdated
@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 8a1a9ea to 421fb30CompareApril 18, 2020 12:34
Comment threadext/sockets/sockets.c Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Indentation

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added try but no change in output?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

I'll drop it, as I'm using WSL, I get test failures due to the protocols not being available so I've added it to catch the failure on CI, but seems like there is none.

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Ah no I remember why, this was when I still had the changes in conversion.c which I decided to drop

@nikic

Copy link
Copy Markdown
Member

Looks fine to me apart from some nits.

@Girgias
Girgiasforce-pushed the sockets-warnings-to-errors branch from 2869ccb to 7ff8eaaCompareApril 21, 2020 18:41
@php-pulls
php-pulls merged commit 7ff8eaa into php:masterApr 21, 2020
@Girgias
Girgias deleted the sockets-warnings-to-errors branch April 21, 2020 21:42
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Girgias@nikic@kocsismate@php-pulls