Var: Add version to deprecated initialization

This has been added for Zeek 5.0, so mark it for removal in Zeek 6.1.
This commit is contained in:
Arne Welzel 2023-03-17 15:43:36 +01:00
parent bb80d80218
commit c1f51cbf2a
3 changed files with 5 additions and 4 deletions

View file

@ -193,7 +193,8 @@ static void make_var(const IDPtr& id, TypePtr t, InitClass c, ExprPtr init,
{
// This can happen because the grammar allows any "init_class",
// including none, to be followed by an expression.
init->Warn("initialization not preceded by =/+=/-= is deprecated");
// Remove in v6.1 (make an error)
init->Warn("Remove in v6.1. Initialization not preceded by =/+=/-= is deprecated.");
// The historical instances of these, such as the
// language/redef-same-prefixtable-idx.zeek btest, treat

View file

@ -1,7 +1,7 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
error in <...>/init-mismatch.zeek, line 6: invalid constructor list on RHS of assignment (a = 3, 5)
error in <...>/init-mismatch.zeek, line 6: assignment of non-arithmetic value to arithmetic (count/types) (a = 3, 5)
warning in <...>/init-mismatch.zeek, line 7: initialization not preceded by =<...>/-= is deprecated (4, 6)
warning in <...>/init-mismatch.zeek, line 7: Remove in v6.1. Initialization not preceded by =<...>/-= is deprecated. (4, 6)
error in <...>/init-mismatch.zeek, line 13: different number of indices (list of count,count and list of count,count,count)
error in <...>/init-mismatch.zeek, line 14: table constructor element lacks '=' structure (bar)
error in <...>/init-mismatch.zeek, line 17: empty list in untyped initialization ()

View file

@ -1,3 +1,3 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
warning in <...>/redef-same-prefixtable-idx.zeek, line 7: initialization not preceded by =<...>/-= is deprecated (3.0.0.0/8 = 1.0.0.0/8)
warning in <...>/redef-same-prefixtable-idx.zeek, line 8: initialization not preceded by =<...>/-= is deprecated (3.0.0.0/8 = 2.0.0.0/8)
warning in <...>/redef-same-prefixtable-idx.zeek, line 7: Remove in v6.1. Initialization not preceded by =<...>/-= is deprecated. (3.0.0.0/8 = 1.0.0.0/8)
warning in <...>/redef-same-prefixtable-idx.zeek, line 8: Remove in v6.1. Initialization not preceded by =<...>/-= is deprecated. (3.0.0.0/8 = 2.0.0.0/8)