Breakage in yp.c
| From: | Jon Parise | Date: | Sat, 07 Apr 2001 17:45:46 +0000 |
| Subject: | Breakage in yp.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-51108@lists.php.net to get a copy of this message | ||
Revision 1.16 and later of ext/yp/yp.c fails to build under Solaris 8
with WorkShop Compilers 5.0 98/12/15 C 5.0. The compilation dies with
the following errors:
"yp.c", line 218: non-constant initializer: op "U&"
"yp.c", line 218: non-constant initializer: op "U&"
"yp.c", line 218: non-constant initializer: op "U&"
My knowledge of C portability is weak in these cases, but the
following patch appears to fix things here. Can some of you more
knowledgeable folks give this a quick look and let me know if it's
okay for me to commit this?
--
Jon Parise (jon@csh.rit.edu) . Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/ : Computer Science House
Member
Index: yp.c =================================================================== RCS file: /repository/php4/ext/yp/yp.c,v retrieving revision 1.19 diff -u -r1.19 yp.c --- yp.c 2001/03/20 20:04:41 1.19 +++ yp.c 2001/04/07 17:36:16 @@ -215,9 +215,13 @@ { int r; zval *status, *key, *value; - zval **args [3] = { &status, &key, &value }; + zval **args [3]; zval *retval; CLS_FETCH(); + + args[0] = &status; + args[1] = &key; + args[2] = &value; MAKE_STD_ZVAL (status); ZVAL_LONG (status, ypprot_err (instatus));
Index: yp.c =================================================================== RCS file: /repository/php4/ext/yp/yp.c,v retrieving revision 1.19 diff -u -r1.19 yp.c --- yp.c 2001/03/20 20:04:41 1.19 +++ yp.c 2001/04/07 17:36:16 @@ -215,9 +215,13 @@ { int r; zval *status, *key, *value; - zval **args [3] = { &status, &key, &value }; + zval **args [3]; zval *retval; CLS_FETCH(); + + args[0] = &status; + args[1] = &key; + args[2] = &value; MAKE_STD_ZVAL (status); ZVAL_LONG (status, ypprot_err (instatus));