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 warnings in compilation using clang 15 #3904

Merged
merged 2 commits into from
Feb 22, 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: 0 additions & 2 deletions backends/dpdk/dpdkContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ Util::JsonObject *DpdkContextGenerator::addMatchAttributes(const IR::P4Table *ta
auto *immFldArray = new Util::JsonArray();
if (attr.params) {
int index = 0;
int position = 0;
int param_width = 8; // Minimum width for dpdk action params
for (auto param : *(attr.params)) {
if (param->type->is<IR::Type_Bits>()) {
Expand All @@ -346,7 +345,6 @@ Util::JsonObject *DpdkContextGenerator::addMatchAttributes(const IR::P4Table *ta
}
addImmediateField(immFldArray, param->name.originalName, index / 8, param_width);
index += param_width;
position++;
}
}
oneAction->emplace("immediate_fields", immFldArray);
Expand Down
2 changes: 0 additions & 2 deletions backends/ubpf/ubpfTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ void UBPFTable::emitKeyType(EBPF::CodeBuilder *builder) {
if (keyGenerator != nullptr) {
// Use this to order elements by size
std::multimap<size_t, const IR::KeyElement *> ordered;
unsigned fieldNumber = 0;
for (auto c : keyGenerator->keyElements) {
auto type = program->typeMap->getType(c->expression);
auto ebpfType = UBPFTypeFactory::instance->create(type);
Expand All @@ -259,7 +258,6 @@ void UBPFTable::emitKeyType(EBPF::CodeBuilder *builder) {
ordered.emplace(width, c);
keyTypes.emplace(c, ebpfType);
keyFieldNames.emplace(c, fieldName);
fieldNumber++;
}

// Emit key in decreasing order size - this way there will be no gaps
Expand Down
6 changes: 6 additions & 0 deletions frontends/parsers/p4/p4parser.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ limitations under the License.
#include "lib/cstring.h"
#include "lib/source_file.h"

#ifdef __clang__
#if __clang_major__ >= 13
#pragma clang diagnostic ignored "-Wunused-but-set-variable"
#endif
#endif

namespace P4 {
class AbstractP4Lexer;
class P4ParserDriver;
Expand Down