Skip to content

Conversation

@iluuu1994
Copy link
Member

Fixes GH-20270

@@ -0,0 +1,49 @@
--TEST--
GH-20270: Parent hook call with named arguments
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to self: Missing --CREDITS--.

Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

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

Technically looks fine, not sure if you need to explicitly zero more fields to silence compile warnings on some compilers/platforms. They should be zero'd on their own.

@iluuu1994
Copy link
Member Author

to silence compile warnings on some compilers/platforms

Okay, didn't know about this. Will do.

@iluuu1994
Copy link
Member Author

Took a quick look, for GCC I could see:

https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wmissing-field-initializers

-Wmissing-field-initializers

Warn if a structure’s initializer has some fields missing. For example, the following code causes such a warning, because x.h is implicitly zero:

struct s { int f, g, h; };
struct s x = { 3, 4 };

In C this option does not warn about designated initializers, so the following modification does not trigger a warning:

struct s { int f, g, h; };
struct s x = { .f = 3, .g = 4 };

In other words, this warning doesn't apply here. The same goes for Clang. I couldn't find an equivalent option for MSVC at all. I also found a few existing examples in php-src where not all fields are being set, indicating this is probably not an issue.

static struct fpm_array_s cleanups = { .sz = sizeof(struct cleanup_s) };

zend_ffi_val val = {.kind = ZEND_FFI_VAL_EMPTY};

@nielsdos
Copy link
Member

Thanks for checking, LGTM then!

Sign up for free to 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.

2 participants