X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/8f3596a6337cf30a3641967d450d1c9d77861edc..7a0db73e6faa349ef6dac9a8c5efe9f95fe4d994:/NEWS diff --git a/NEWS b/NEWS index 2b7c1013..784efeb7 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,17 @@ Changes in version 2.1a: | exp "+" exp { $$ = $1; (void) $3; } ; + If there are mid-rule actions, the warning is issued if no action + uses it. The following triggers no warning: $1 and $3 are used. + + exp: exp { push ($1); } '+' exp { push ($3); sum (); }; + + Mid-rule actions that use $$ cause the corresponding value to be + set, therefore the following action must use it. The following rule + triggers a warning about $2. + + exp: '1' { $$ = 1; } '+' exp { $$ = $1 + $4; }; + The warning is intended to help catching lost values and memory leaks. If a value is ignored, its associated memory typically is not reclaimed.