Skip to content

Fix php8 compile error using zend_parse_parameters_throw() #4896

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

Conversation

TysonAndre
Copy link
Contributor

Fixes a bug introduced in 4008704

The trailing comma is followed by ) when the varargs list
is empty in the macro, which is a syntax error in C

This fixes compilation of code such as the following

PHP_FUNCTION(get_metadata) {
  if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "") == FAILURE) {
    return;
  }

Fixes a bug introduced in 4008704

The trailing comma is followed by `)` when the varargs list
is empty in the macro, which is a syntax error in C

This fixes compilation of code such as the following

    PHP_FUNCTION(get_metadata) {
      if (zend_parse_parameters_throw(ZEND_NUM_ARGS(), "") == FAILURE) {
        return;
      }
@nikic
Copy link
Member

nikic commented Nov 8, 2019

Are you on Windows?

@TysonAndre
Copy link
Contributor Author

No, I'm not. I'm using gcc 5.4.0 on linux mint

~ » gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.12) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@php-pulls php-pulls closed this in 70b4bc9 Nov 8, 2019
@cmb69
Copy link
Member

cmb69 commented Nov 8, 2019

@TysonAndre TysonAndre deleted the zend_parse_parameters_throw-parser-error branch December 7, 2019 16:42
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