Skip to content

Commit 2127a37

Browse files
akimdkocsismate
authored andcommitted
Bison: enable all the warnings and fix them
First, fix 5547d36: the definition of YFLAGS was not passed into the Makefile: AC_SUBST does not suffice, we need PHP_SUBST_OLD. While at it, allow to pass variable and value at the same time. Then pass -Wall to bison, rather than only -Wempty-rules. Use %precedence where associativity is useless. Remove useless %precedence. GH-5138
1 parent b97c9dc commit 2127a37

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Zend/zend_ini_parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ static void zval_ini_dtor(zval *zv)
309309
%token END_OF_LINE
310310
%token '=' ':' ',' '.' '"' '\'' '^' '+' '-' '/' '*' '%' '$' '~' '<' '>' '?' '@' '{' '}'
311311
%left '|' '&' '^'
312-
%right '~' '!'
312+
%precedence '~' '!'
313313
314314
%destructor { zval_ini_dtor(&$$); } TC_RAW TC_CONSTANT TC_NUMBER TC_STRING TC_WHITESPACE TC_LABEL TC_OFFSET TC_VARNAME BOOL_TRUE BOOL_FALSE NULL_NULL cfg_var_ref constant_literal constant_string encapsed_list expr option_offset section_string_or_value string_or_value var_string_list var_string_list_section
315315

Zend/zend_language_parser.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static YYSIZE_T zend_yytnamerr(char*, const char*);
7979
%precedence T_INSTANCEOF
8080
%precedence '~' T_INT_CAST T_DOUBLE_CAST T_STRING_CAST T_ARRAY_CAST T_OBJECT_CAST T_BOOL_CAST T_UNSET_CAST '@'
8181
%right T_POW
82-
%precedence T_NEW T_CLONE
82+
%precedence T_CLONE
8383

8484
/* Resolve danging else conflict */
8585
%precedence T_NOELSE

build/php.m4

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,22 +81,22 @@ AC_DEFUN([PHP_DEFINE],[
8181
dnl
8282
dnl PHP_SUBST(varname)
8383
dnl
84-
dnl Adds variable with it's value into Makefile, e.g.:
84+
dnl Adds variable with its value into Makefile, e.g.:
8585
dnl CC = gcc
8686
dnl
8787
AC_DEFUN([PHP_SUBST],[
8888
PHP_VAR_SUBST="$PHP_VAR_SUBST $1"
8989
])
9090

9191
dnl
92-
dnl PHP_SUBST_OLD(varname)
92+
dnl PHP_SUBST_OLD(varname, [VALUE])
9393
dnl
9494
dnl Same as PHP_SUBST() but also substitutes all @VARNAME@ instances in every
9595
dnl file passed to AC_OUTPUT.
9696
dnl
9797
AC_DEFUN([PHP_SUBST_OLD],[
98-
PHP_SUBST($1)
99-
AC_SUBST($1)
98+
AC_SUBST($@)
99+
PHP_SUBST([$1])
100100
])
101101

102102
dnl
@@ -1815,7 +1815,7 @@ AC_DEFUN([PHP_PROG_BISON], [
18151815
done
18161816
18171817
if test "$php_bison_check" != "invalid"; then
1818-
AC_SUBST([YFLAGS], [-Wempty-rule])
1818+
PHP_SUBST_OLD([YFLAGS], [-Wall])
18191819
AC_MSG_RESULT([$php_bison_version (ok)])
18201820
else
18211821
AC_MSG_RESULT([$php_bison_version])

0 commit comments

Comments
 (0)