Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn on unused controls/parsers #4440

Merged
merged 3 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions frontends/p4/unusedDeclarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ const IR::Node *RemoveUnusedDeclarations::preorder(IR::Type_SerEnum *type) {
const IR::Node *RemoveUnusedDeclarations::preorder(IR::P4Control *cont) {
auto orig = getOriginal<IR::P4Control>();
if (!refMap->isUsed(orig)) {
if (giveWarning(orig))
warn(ErrorType::WARN_UNUSED, "Control %2% is not used; removing", cont,
cont->externalName());
LOG3("Removing " << cont << dbp(orig));
prune();
return nullptr;
Expand All @@ -68,6 +71,9 @@ const IR::Node *RemoveUnusedDeclarations::preorder(IR::P4Control *cont) {
const IR::Node *RemoveUnusedDeclarations::preorder(IR::P4Parser *parser) {
auto orig = getOriginal<IR::P4Parser>();
if (!refMap->isUsed(orig)) {
if (giveWarning(orig))
warn(ErrorType::WARN_UNUSED, "Parser %2% is not used; removing", parser,
parser->externalName());
LOG3("Removing " << parser << dbp(orig));
prune();
return nullptr;
Expand Down
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/actionAnnotations.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
actionAnnotations.p4(17): [--Wwarn=unused] warning: Control test is not used; removing
control test()
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/alias.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
alias.p4(38): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/annotations.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
annotations.p4(30): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/apply-cf.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
apply-cf.p4(19): [--Wwarn=unused] warning: Control x is not used; removing
control x()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/assign.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
assign.p4(21): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/bfd_offload.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
bfd_offload.p4(44): [--Wwarn=unused] warning: Control for_rx_bfd_packets is not used; removing
control for_rx_bfd_packets() {
^^^^^^^^^^^^^^^^^^
bfd_offload.p4(50): [--Wwarn=unused] warning: Control for_tx_bfd_packets is not used; removing
control for_tx_bfd_packets() {
^^^^^^^^^^^^^^^^^^
bfd_offload.p4(29): [--Wwarn=unused] warning: bfd_session_liveness_tracker: unused instance
BFD_Offload(32768) bfd_session_liveness_tracker = {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/bitwise-and.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
bitwise-and.p4(21): [--Wwarn=unused] warning: Control C is not used; removing
control C(bit<1> meta) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
[--Wwarn=missing] warning: Program does not contain a main module, so P4Info's 'pkg_info' field will not be set
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/bitwise-cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
bitwise-cast.p4(19): [--Wwarn=unused] warning: Control p is not used; removing
control p() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/bool_cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
bool_cast.p4(17): [--Wwarn=unused] warning: Control SetAndFwd is not used; removing
control SetAndFwd()
^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/bool_double_cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
bool_double_cast.p4(17): [--Wwarn=unused] warning: Control SetAndFwd is not used; removing
control SetAndFwd()
^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/bool_to_bit_cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bool_to_bit_cast.p4(45): [--Wwarn=unused] warning: Control C is not used; removing
control C() {
^
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/call.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
call.p4(17): [--Wwarn=unused] warning: Control qp is not used; removing
control qp()
^^
call.p4(42): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/cases.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
cases.p4(31): [--Wwarn=missing] warning: SwitchCase: fallthrough with no statement
c:
^
cases.p4(17): [--Wwarn=unused] warning: Control ctrl is not used; removing
control ctrl() {
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
cast.p4(17): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/constants.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
constants.p4(17): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/constructor_cast.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
constructor_cast.p4(21): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/crash-typechecker.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
crash-typechecker.p4(11): [--Wwarn=unused] warning: Control x is not used; removing
control x() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/decl.p4-stderr
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ decl.p4(37): [--Wwarn=shadow] warning: 'y' shadows 'y'
decl.p4(33)
bit y;
^^^^^^
decl.p4(17): [--Wwarn=unused] warning: Control p is not used; removing
control p(in bit y_0)
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/default-switch.p4-stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ default-switch.p4(13): [--Wwarn=ordering] warning: b: label following 'default'
default-switch.p4(12)
default:
^^^^^^^
default-switch.p4(1): [--Wwarn=unused] warning: Control ctrl is not used; removing
control ctrl() {
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/direct-call.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
direct-call.p4(20): [--Wwarn=unused] warning: Control d is not used; removing
control d() {
^
direct-call.p4(16): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/direct-call1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
direct-call1.p4(7): [--Wwarn=unused] warning: Parser q is not used; removing
parser q() {
^
direct-call1.p4(1): [--Wwarn=unused] warning: Parser p is not used; removing
parser p() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/direct-call2.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
direct-call2.p4(7): [--Wwarn=unused] warning: Parser q is not used; removing
parser q() {
^
direct-call2.p4(1): [--Wwarn=unused] warning: Parser p is not used; removing
parser p() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/entries-prio.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
entries-prio.p4(12): [--Wwarn=unused] warning: Control c is not used; removing
control c(in Headers h) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/enum.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
enum.p4(24): [--Wwarn=unused] warning: Control c is not used; removing
control c()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/expression.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
expression.p4(17): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/extern2.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
extern2.p4(22): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/extern3.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
extern3.p4(23): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/fold_match.p4-stderr
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,7 @@ fold_match.p4(105): [--Wwarn=parser-transition] warning: SelectCase: unreachable
fold_match.p4(111): [--Wwarn=parser-transition] warning: SelectExpression: no case matches
transition select(32w0)
^
fold_match.p4(17): [--Wwarn=unused] warning: Parser p is not used; removing
parser p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/generic.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
generic.p4(17): [--Wwarn=unused] warning: 'T' is unused
extern Crc16<T>
^
generic.p4(27): [--Wwarn=unused] warning: Control q is not used; removing
control q<S>(in S dt)
^
generic.p4(41): [--Wwarn=unused] warning: Control z is not used; removing
control z<D1, T1>(X<D1> x, in D1 v, in T1 t)
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/hashext.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
hashext.p4(36): [--Wwarn=unused] warning: Control test is not used; removing
control test(inout hdrs hdr) {
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/hashext2.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
hashext2.p4(33): [--Wwarn=unused] warning: Control test is not used; removing
control test(inout hdrs hdr) {
^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/header.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
header.p4(42): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/initializer.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
initializer.p4(19): [--Wwarn=unused] warning: Control ingress is not used; removing
control ingress(out bit<32> field_d_32) {
^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/interface2.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
interface2.p4(21): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/issue1304.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
issue1304.p4(32): [--Wwarn=unused] warning: Control MyVerifyChecksum is not used; removing
control MyVerifyChecksum(inout my_packet hdr, inout my_metadata meta) {
^^^^^^^^^^^^^^^^
issue1304.p4(54): [--Wwarn=unused] warning: Control MyComputeChecksum is not used; removing
control MyComputeChecksum(inout my_packet p, inout my_metadata m) {
^^^^^^^^^^^^^^^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1334.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue1334.p4(14): [--Wwarn=unused] warning: Control d is not used; removing
control d(out bit<32> x)(bit<32> a) {
^
6 changes: 6 additions & 0 deletions testdata/p4_16_samples_outputs/issue1524.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
issue1524.p4(36): [--Wwarn=unused] warning: Parser ParserImpl is not used; removing
parser ParserImpl(packet_in packet,
^^^^^^^^^^
issue1524.p4(50): [--Wwarn=unused] warning: Control bar is not used; removing
control bar() {
^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
[--Wwarn=missing] warning: Program does not contain a main module, so P4Info's 'pkg_info' field will not be set
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1586.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue1586.p4(3): [--Wwarn=unused] warning: Control cIngress is not used; removing
control cIngress()
^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1914-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue1914-1.p4(83): [--Wwarn=unused] warning: Control verifyChecksum is not used; removing
control verifyChecksum(inout headers_t hdr, inout metadata_t meta) {
^^^^^^^^^^^^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1914-2.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue1914-2.p4(83): [--Wwarn=unused] warning: Control verifyChecksum is not used; removing
control verifyChecksum(inout headers_t hdr, inout metadata_t meta) {
^^^^^^^^^^^^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1914.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue1914.p4(83): [--Wwarn=unused] warning: Control verifyChecksum is not used; removing
control verifyChecksum(inout headers_t hdr, inout metadata_t meta) {
^^^^^^^^^^^^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1989-bmv2.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue1989-bmv2.p4(38): [--Wwarn=unused] warning: Control ingress_stub is not used; removing
control ingress_stub(inout headers hdr, inout test_metadata_t meta,
^^^^^^^^^^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue1997.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue1997.p4(23): [--Wwarn=unused] warning: Control c is not used; removing
control c(in hdr h, inout standard_metadata_t standard_meta) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2036-3.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2036-3.p4(7): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2037.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2037.p4(2): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2090.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
spec-ex09.p4(24): [--Wwarn=unused] warning: Control p is not used; removing
control p()
^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2126.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2126.p4(1): [--Wwarn=unused] warning: Parser p is not used; removing
parser p() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2265-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2265-1.p4(3): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2265.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2265.p4(7): [--Wwarn=unused] warning: Control c is not used; removing
control c<T>(inout T data) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2514.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue2514.p4(23): [--Wwarn=unused] warning: Parser prs is not used; removing
parser prs(inout my_headers_t hdr) {
^^^
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2735.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
issue2735.p4(8): [--Wwarn=unused] warning: Control SnvsIngress is not used; removing
control SnvsIngress(out Mac_entry b0) {
^^^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
[--Wwarn=missing] warning: Program does not contain a main module, so P4Info's 'pkg_info' field will not be set
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue2905.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue2905.p4(3): [--Wwarn=unused] warning: Control c is not used; removing
control c() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3056.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3056.p4(6): [--Wwarn=unused] warning: Control compute is not used; removing
control compute() {
^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3246-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3246-1.p4(8): [--Wwarn=unused] warning: Control c is not used; removing
control c(out bit<8> result) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3307.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3307.p4(6): [--Wwarn=unused] warning: Parser MyParser is not used; removing
parser MyParser(t tt) {
^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3333.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3333.p4(2): [--Wwarn=unused] warning: Parser MyParser1 is not used; removing
parser MyParser1(in myenum a) {
^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3343.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3343.p4(1): [--Wwarn=unused] warning: Parser MyParser1 is not used; removing
parser MyParser1(in bit<6> ttt) {
^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3379-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
issue3379-1.p4(14): [--Wwarn=unused] warning: t4: unused instance
mypackaget<bit>(MyParser1()) t4;
^^
issue3379-1.p4(3): [--Wwarn=unused] warning: Parser MyParser1 is not used; removing
parser MyParser1(in bit tt) {
^^^^^^^^^
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grg Do you know why Myparser1 is considered unused in this test program?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that is because there is no main declaration.

[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3379.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
issue3379.p4(15): [--Wwarn=unused] warning: t4: unused instance
mypackaget(MyParser1()) t4;
^^
issue3379.p4(3): [--Wwarn=unused] warning: Parser MyParser1 is not used; removing
parser MyParser1(in bit tt) {
^^^^^^^^^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue344.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
issue344.p4(24): [--Wwarn=unused] warning: c: unused instance
top(C<_>()) c;
^
issue344.p4(17): [--Wwarn=unused] warning: Control C is not used; removing
control C<H>() {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue361-bmv2.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue361-bmv2.p4(46): [--Wwarn=unused] warning: Control C is not used; removing
control C() {
^
[--Wwarn=parser-transition] warning: SelectCase: unreachable case
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3619.p4-stderr
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
issue3619.p4(4): [--Wwarn=missing] warning: SwitchCase: fallthrough with no statement
default:
^^^^^^^
issue3619.p4(1): [--Wwarn=unused] warning: Control c is not used; removing
control c(in bit<4> v) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3623-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3623-1.p4(5): [--Wwarn=unused] warning: Control c is not used; removing
control c(in e v)
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3623.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3623.p4(5): [--Wwarn=unused] warning: Control c is not used; removing
control c(in bit<4> v) {
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3671-1.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3671-1.p4(10): [--Wwarn=unused] warning: Control c is not used; removing
control c()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
3 changes: 3 additions & 0 deletions testdata/p4_16_samples_outputs/issue3671.p4-stderr
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
issue3671.p4(11): [--Wwarn=unused] warning: Control c is not used; removing
control c()
^
[--Wwarn=missing] warning: Program does not contain a `main' module
Loading
Loading