Skip to content

Commit

Permalink
Fix invalid string format specifier (#4145)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhavrane authored Sep 8, 2023
1 parent 1902890 commit 87d362f
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion ir/ir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const IR::PackageBlock *ToplevelBlock::getMain() const {
return nullptr;
}
if (!main->is<IR::Declaration_Instance>()) {
::error(ErrorType::ERR_INVALID, "%1$: must be a package declaration", main->getNode());
::error(ErrorType::ERR_INVALID, "%1%: must be a package declaration", main->getNode());
return nullptr;
}
auto block = getValue(main->getNode());
Expand Down
3 changes: 3 additions & 0 deletions testdata/p4_16_errors/issue4144.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include <core.p4>

extern main {}
5 changes: 5 additions & 0 deletions testdata/p4_16_errors_outputs/issue4144-first.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <core.p4>

extern main {
}

5 changes: 5 additions & 0 deletions testdata/p4_16_errors_outputs/issue4144-frontend.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <core.p4>

extern main {
}

5 changes: 5 additions & 0 deletions testdata/p4_16_errors_outputs/issue4144.p4
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include <core.p4>

extern main {
}

3 changes: 3 additions & 0 deletions testdata/p4_16_errors_outputs/issue4144.p4-stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
issue4144.p4(3): [--Werror=invalid] error: main: must be a package declaration
extern main {}
^^^^

0 comments on commit 87d362f

Please sign in to comment.