mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Copy docs into Zeek repo directly
This is based on commit 2731def9159247e6da8a3191783c89683363689c from the zeek-docs repo.
This commit is contained in:
parent
83f1e74643
commit
ded98cd373
1074 changed files with 169319 additions and 0 deletions
26
doc/scripting/usage.rst
Normal file
26
doc/scripting/usage.rst
Normal file
|
@ -0,0 +1,26 @@
|
|||
|
||||
.. _script-usage-errors:
|
||||
|
||||
==============================
|
||||
Finding Potential Usage Errors
|
||||
==============================
|
||||
|
||||
Usage errors concern variables used-but-not-guaranteed-set or
|
||||
set-but-not-ever-used. Zeek generates reports for these if you specify
|
||||
the ``-u`` flag. It exits after producing the report, so if it simply exits
|
||||
with no output, then it did not find any usage errors.
|
||||
|
||||
Variables reported as "used without definition" appear to have a code path
|
||||
to them the could access their value even though it has not been initialized.
|
||||
If upon inspection you determine that there is no actual hazard, you can
|
||||
mark the definition with an :zeek:attr:`&is_assigned` attribute to assure the optimizer
|
||||
that the value will be set.
|
||||
|
||||
Variables reported as "assignment unused" have a value assigned to them
|
||||
that is meaningless since prior to any use of that value, another value
|
||||
is assigned to the same variable. Such assignments are worth inspecting
|
||||
as they sometimes reflect logic errors. Similar logic applies to unused
|
||||
event handlers, hooks, and functions. You can suppress these reports by
|
||||
adding an :zeek:attr:`&is_used` attribute to the original definition. If the
|
||||
determination is indeed incorrect, that represents a bug in Zeek's analysis,
|
||||
so something to report via the Issue Tracker.
|
Loading…
Add table
Add a link
Reference in a new issue