Skip to content

Commit 321c577

Browse files
committed
PHPC-285: Fix syntax for empty struct initializer
While "{ 0 }" should be sufficient, gcc's missing-braces warning requires that an extra pair of braces be used. See: http://stackoverflow.com/q/11551986 and http://stackoverflow.com/a/20405554
1 parent efd9331 commit 321c577

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php_bson.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ typedef struct {
7171
} php_phongo_bson_state;
7272

7373
#if PHP_VERSION_ID >= 70000
74-
#define PHONGO_BSON_STATE_INITIALIZER { {}, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL}, NULL}
74+
#define PHONGO_BSON_STATE_INITIALIZER { {{ 0 }}, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL}, NULL}
7575
#else
7676
#define PHONGO_BSON_STATE_INITIALIZER { NULL, { PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL, PHONGO_TYPEMAP_NONE, NULL}, NULL}
7777
#endif

0 commit comments

Comments
 (0)