Skip to content

Commit

Permalink
Make changes to support compiling on Bullseye with GCC 10 (sonic-net#…
Browse files Browse the repository at this point in the history
…2216)

Types of changes done:
* Add missing includes in header files and .cpp files
* Don't use parentheses when doing list initialization in constructors
* Make sure variables are initialized before first use

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
  • Loading branch information
saiarcot895 authored Apr 4, 2022
1 parent 0870cf5 commit 50d5be2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
10 changes: 5 additions & 5 deletions cfgmgr/buffermgrdyn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@ using namespace swss;
BufferMgrDynamic::BufferMgrDynamic(DBConnector *cfgDb, DBConnector *stateDb, DBConnector *applDb, const vector<TableConnector> &tables, shared_ptr<vector<KeyOpFieldsValuesTuple>> gearboxInfo, shared_ptr<vector<KeyOpFieldsValuesTuple>> zeroProfilesInfo) :
Orch(tables),
m_platform(),
m_bufferDirections({BUFFER_INGRESS, BUFFER_EGRESS}),
m_bufferObjectNames({"priority group", "queue"}),
m_bufferDirectionNames({"ingress", "egress"}),
m_bufferDirections{BUFFER_INGRESS, BUFFER_EGRESS},
m_bufferObjectNames{"priority group", "queue"},
m_bufferDirectionNames{"ingress", "egress"},
m_applDb(applDb),
m_zeroProfilesLoaded(false),
m_supportRemoving(true),
m_cfgDefaultLosslessBufferParam(cfgDb, CFG_DEFAULT_LOSSLESS_BUFFER_PARAMETER),
m_cfgDeviceMetaDataTable(cfgDb, CFG_DEVICE_METADATA_TABLE_NAME),
m_applBufferPoolTable(applDb, APP_BUFFER_POOL_TABLE_NAME),
m_applBufferProfileTable(applDb, APP_BUFFER_PROFILE_TABLE_NAME),
m_applBufferObjectTables({ProducerStateTable(applDb, APP_BUFFER_PG_TABLE_NAME), ProducerStateTable(applDb, APP_BUFFER_QUEUE_TABLE_NAME)}),
m_applBufferProfileListTables({ProducerStateTable(applDb, APP_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME), ProducerStateTable(applDb, APP_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME)}),
m_applBufferObjectTables{ProducerStateTable(applDb, APP_BUFFER_PG_TABLE_NAME), ProducerStateTable(applDb, APP_BUFFER_QUEUE_TABLE_NAME)},
m_applBufferProfileListTables{ProducerStateTable(applDb, APP_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME), ProducerStateTable(applDb, APP_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME)},
m_statePortTable(stateDb, STATE_PORT_TABLE_NAME),
m_stateBufferMaximumTable(stateDb, STATE_BUFFER_MAXIMUM_VALUE_TABLE),
m_stateBufferPoolTable(stateDb, STATE_BUFFER_POOL_TABLE_NAME),
Expand Down
1 change: 1 addition & 0 deletions lib/subintf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <cstring>
#include <array>
#include <net/if.h>
#include <stdexcept>
#include "subintf.h"

using namespace swss;
Expand Down
2 changes: 2 additions & 0 deletions lib/subintf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <string>

#define VLAN_SUB_INTERFACE_SEPARATOR "."
namespace swss {
class subIntf
Expand Down
1 change: 1 addition & 0 deletions orchagent/directory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <typeinfo>
#include <string>
#include <stdexcept>
#include <unordered_map>
#include <algorithm>

Expand Down
2 changes: 1 addition & 1 deletion orchagent/mplsrouteorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ bool RouteOrch::addLabelRoute(LabelRouteBulkContext& ctx, const NextHopGroupKey
Label& label = ctx.label;

/* next_hop_id indicates the next hop id or next hop group id of this route */
sai_object_id_t next_hop_id;
sai_object_id_t next_hop_id = SAI_NULL_OBJECT_ID;
bool blackhole = false;

if (m_syncdLabelRoutes.find(vrf_id) == m_syncdLabelRoutes.end())
Expand Down

0 comments on commit 50d5be2

Please sign in to comment.