diff --git a/auxil/spicy-plugin b/auxil/spicy-plugin index 945b5994de..248f839a0f 160000 --- a/auxil/spicy-plugin +++ b/auxil/spicy-plugin @@ -1 +1 @@ -Subproject commit 945b5994de4fb85bc015ac9da0921f162ea0b8e9 +Subproject commit 248f839a0f419af0b56f781443f4adc244f08329 diff --git a/src/Attr.h b/src/Attr.h index 9c1ec16f1b..780c39ac47 100644 --- a/src/Attr.h +++ b/src/Attr.h @@ -99,7 +99,7 @@ public: return true; } - detail::TraversalCode Traverse(detail::TraversalCallback* cb) const; + detail::TraversalCode Traverse(detail::TraversalCallback* cb) const; protected: void AddTag(ODesc* d) const; @@ -132,7 +132,7 @@ public: bool operator==(const Attributes& other) const; - detail::TraversalCode Traverse(detail::TraversalCallback* cb) const; + detail::TraversalCode Traverse(detail::TraversalCallback* cb) const; protected: void CheckAttr(Attr* attr); diff --git a/src/Options.cc b/src/Options.cc index c7ec33bf29..ea9754a775 100644 --- a/src/Options.cc +++ b/src/Options.cc @@ -107,7 +107,8 @@ void usage(const char* prog, int code) fprintf(stderr, " -s|--rulefile | read rules from given file\n"); fprintf(stderr, " -t|--tracefile | activate execution tracing\n"); fprintf(stderr, " -u|--usage-issues | find variable usage issues and exit\n"); - fprintf(stderr, " --no-usage-warnings | suppress warnings of unused functions/hooks/events\n"); + fprintf(stderr, " --no-usage-warnings | suppress warnings of unused " + "functions/hooks/events\n"); fprintf(stderr, " -v|--version | print version and exit\n"); fprintf(stderr, " -w|--writefile | write to given tcpdump file\n"); #ifdef DEBUG diff --git a/src/script_opt/UsageAnalyzer.cc b/src/script_opt/UsageAnalyzer.cc index 7eb00974d8..102d021c5f 100644 --- a/src/script_opt/UsageAnalyzer.cc +++ b/src/script_opt/UsageAnalyzer.cc @@ -1,8 +1,9 @@ // See the file "COPYING" in the main distribution directory for copyright. +#include "zeek/script_opt/UsageAnalyzer.h" + #include "zeek/module_util.h" #include "zeek/script_opt/IDOptInfo.h" -#include "zeek/script_opt/UsageAnalyzer.h" namespace zeek::detail { @@ -51,7 +52,8 @@ UsageAnalyzer::UsageAnalyzer(std::vector& funcs) auto flavor = t->AsFuncType()->FlavorString(); auto loc = id->GetLocationInfo(); - reporter->Warning("%s %s (%s:%d): cannot be invoked", flavor.c_str(), id->Name(), loc->filename, loc->first_line); + reporter->Warning("%s %s (%s:%d): cannot be invoked", flavor.c_str(), id->Name(), + loc->filename, loc->first_line); // Don't ding any functions that are reachable via this // identifier. This will also suppress flagging other events @@ -75,7 +77,8 @@ UsageAnalyzer::UsageAnalyzer(std::vector& funcs) auto loc = id->GetLocationInfo(); - reporter->Warning("function %s (%s:%d): cannot be called", id->Name(), loc->filename, loc->first_line); + reporter->Warning("function %s (%s:%d): cannot be called", id->Name(), loc->filename, + loc->first_line); // Unlike for events/hooks above, we don't add the function to // the reachables. This is because an orphan function is a diff --git a/testing/btest/Baseline/core.check-unused-event-handlers/.stderr b/testing/btest/Baseline/core.check-unused-event-handlers/.stderr index a695ee772a..0bf43736d5 100644 --- a/testing/btest/Baseline/core.check-unused-event-handlers/.stderr +++ b/testing/btest/Baseline/core.check-unused-event-handlers/.stderr @@ -9,4 +9,4 @@ warning in , line 1: event handler never invoked: SupervisorControl::sta warning in , line 1: event handler never invoked: SupervisorControl::stop_request warning in , line 1: event handler never invoked: spicy_analyzer_for_mime_type warning in , line 1: event handler never invoked: this_is_never_used -warning in , line 1: event this_is_never_used (<...>/check-unused-event-handlers.test:5): cannot be invoked +warning in , line 1: event this_is_never_used (<...>/check-unused-event-handlers.test:6): cannot be invoked diff --git a/testing/btest/Baseline/language.table-type-checking/out b/testing/btest/Baseline/language.table-type-checking/out index 0e6a3b7cd3..54a8b0534d 100644 --- a/testing/btest/Baseline/language.table-type-checking/out +++ b/testing/btest/Baseline/language.table-type-checking/out @@ -14,4 +14,4 @@ error in port and <...>/table-type-checking.zeek, line 42: type clash (port and error in <...>/table-type-checking.zeek, line 42: inconsistent types in table constructor (table(thousand-two = 1002)) error in <...>/table-type-checking.zeek, line 48: type clash in assignment (lea = table(thousand-three = 1003)) error in count and <...>/table-type-checking.zeek, line 54: arithmetic mixed with non-arithmetic (count and foo) -error in <...>/table-type-checking.zeek, line 4 and <...>/table-type-checking.zeek, line 54: &default value has inconsistent type (table[port] of count and table()&default=foo, &optional) +error in <...>/table-type-checking.zeek, line 4 and <...>/table-type-checking.zeek, line 54: &default value has inconsistent type (MyTable and table()&default=foo, &optional) diff --git a/testing/btest/Baseline/spicy.spicyz-aot/output b/testing/btest/Baseline/spicy.spicyz-aot/output index e7ad0949ae..0d214344cc 100644 --- a/testing/btest/Baseline/spicy.spicyz-aot/output +++ b/testing/btest/Baseline/spicy.spicyz-aot/output @@ -1,4 +1,5 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +warning in , line 1: event test::dummy (./test.zeek:3): cannot be invoked 8, [$data=[b"POST /post HTTP/1.1", b"User-Agent: curl/7.29.0", b"Host: httpbin.org", b"Accept: */*", b"Content-Length: 11", b"Content-Type: application/x-www-form-urlencoded", b"", b"hello world"]] Event:, [POST /post HTTP/1.1, User-Agent: curl/7.29.0, Host: httpbin.org, Accept: */*, Content-Length: 11, Content-Type: application/x-www-form-urlencoded, , hello world] 8, [$data=[b"HTTP/1.1 200 OK", b"Server: gunicorn/0.16.1", b"Date: Tue, 19 Mar 2013 16:05:11 GMT", b"Content-Type: application/json", b"Content-Length: 366", b"Connection: close", b"", b"{\x0a \"origin\": \"10.142.133.148\",\x0a \"files\": {},\x0a \"form\": null,\x0a \"url\": \"http://httpbin.org/post\",\x0a \"args\": {},\x0a \"headers\": {\x0a \"Content-Length\": \"11\",\x0a \"Connection\": \"close\",\x0a \"Accept\": \"*/*\",\x0a \"User-Agent\": \"curl/7.29.0\",\x0a \"Host\": \"httpbin.org\",\x0a \"Content-Type\": \"application/x-www-form-urlencoded\"\x0a },\x0a \"json\": null,\x0a \"data\": \"hello world\"\x0a}"]] diff --git a/testing/btest/Baseline/spicy.spicyz-jit/output b/testing/btest/Baseline/spicy.spicyz-jit/output index e7ad0949ae..0d214344cc 100644 --- a/testing/btest/Baseline/spicy.spicyz-jit/output +++ b/testing/btest/Baseline/spicy.spicyz-jit/output @@ -1,4 +1,5 @@ ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. +warning in , line 1: event test::dummy (./test.zeek:3): cannot be invoked 8, [$data=[b"POST /post HTTP/1.1", b"User-Agent: curl/7.29.0", b"Host: httpbin.org", b"Accept: */*", b"Content-Length: 11", b"Content-Type: application/x-www-form-urlencoded", b"", b"hello world"]] Event:, [POST /post HTTP/1.1, User-Agent: curl/7.29.0, Host: httpbin.org, Accept: */*, Content-Length: 11, Content-Type: application/x-www-form-urlencoded, , hello world] 8, [$data=[b"HTTP/1.1 200 OK", b"Server: gunicorn/0.16.1", b"Date: Tue, 19 Mar 2013 16:05:11 GMT", b"Content-Type: application/json", b"Content-Length: 366", b"Connection: close", b"", b"{\x0a \"origin\": \"10.142.133.148\",\x0a \"files\": {},\x0a \"form\": null,\x0a \"url\": \"http://httpbin.org/post\",\x0a \"args\": {},\x0a \"headers\": {\x0a \"Content-Length\": \"11\",\x0a \"Connection\": \"close\",\x0a \"Accept\": \"*/*\",\x0a \"User-Agent\": \"curl/7.29.0\",\x0a \"Host\": \"httpbin.org\",\x0a \"Content-Type\": \"application/x-www-form-urlencoded\"\x0a },\x0a \"json\": null,\x0a \"data\": \"hello world\"\x0a}"]]