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

Fix invalid string format specifier #4145

Merged
merged 1 commit into from
Sep 8, 2023
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
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 {}
^^^^
Loading