Skip to content

Commit 50d5be2

Browse files
authored
Make changes to support compiling on Bullseye with GCC 10 (sonic-net#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 <[email protected]>
1 parent 0870cf5 commit 50d5be2

File tree

5 files changed

+10
-6
lines changed

5 files changed

+10
-6
lines changed

cfgmgr/buffermgrdyn.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,18 @@ using namespace swss;
2929
BufferMgrDynamic::BufferMgrDynamic(DBConnector *cfgDb, DBConnector *stateDb, DBConnector *applDb, const vector<TableConnector> &tables, shared_ptr<vector<KeyOpFieldsValuesTuple>> gearboxInfo, shared_ptr<vector<KeyOpFieldsValuesTuple>> zeroProfilesInfo) :
3030
Orch(tables),
3131
m_platform(),
32-
m_bufferDirections({BUFFER_INGRESS, BUFFER_EGRESS}),
33-
m_bufferObjectNames({"priority group", "queue"}),
34-
m_bufferDirectionNames({"ingress", "egress"}),
32+
m_bufferDirections{BUFFER_INGRESS, BUFFER_EGRESS},
33+
m_bufferObjectNames{"priority group", "queue"},
34+
m_bufferDirectionNames{"ingress", "egress"},
3535
m_applDb(applDb),
3636
m_zeroProfilesLoaded(false),
3737
m_supportRemoving(true),
3838
m_cfgDefaultLosslessBufferParam(cfgDb, CFG_DEFAULT_LOSSLESS_BUFFER_PARAMETER),
3939
m_cfgDeviceMetaDataTable(cfgDb, CFG_DEVICE_METADATA_TABLE_NAME),
4040
m_applBufferPoolTable(applDb, APP_BUFFER_POOL_TABLE_NAME),
4141
m_applBufferProfileTable(applDb, APP_BUFFER_PROFILE_TABLE_NAME),
42-
m_applBufferObjectTables({ProducerStateTable(applDb, APP_BUFFER_PG_TABLE_NAME), ProducerStateTable(applDb, APP_BUFFER_QUEUE_TABLE_NAME)}),
43-
m_applBufferProfileListTables({ProducerStateTable(applDb, APP_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME), ProducerStateTable(applDb, APP_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME)}),
42+
m_applBufferObjectTables{ProducerStateTable(applDb, APP_BUFFER_PG_TABLE_NAME), ProducerStateTable(applDb, APP_BUFFER_QUEUE_TABLE_NAME)},
43+
m_applBufferProfileListTables{ProducerStateTable(applDb, APP_BUFFER_PORT_INGRESS_PROFILE_LIST_NAME), ProducerStateTable(applDb, APP_BUFFER_PORT_EGRESS_PROFILE_LIST_NAME)},
4444
m_statePortTable(stateDb, STATE_PORT_TABLE_NAME),
4545
m_stateBufferMaximumTable(stateDb, STATE_BUFFER_MAXIMUM_VALUE_TABLE),
4646
m_stateBufferPoolTable(stateDb, STATE_BUFFER_POOL_TABLE_NAME),

lib/subintf.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#include <cstring>
33
#include <array>
44
#include <net/if.h>
5+
#include <stdexcept>
56
#include "subintf.h"
67

78
using namespace swss;

lib/subintf.h

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#pragma once
22

3+
#include <string>
4+
35
#define VLAN_SUB_INTERFACE_SEPARATOR "."
46
namespace swss {
57
class subIntf

orchagent/directory.h

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
#include <typeinfo>
88
#include <string>
9+
#include <stdexcept>
910
#include <unordered_map>
1011
#include <algorithm>
1112

orchagent/mplsrouteorch.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ bool RouteOrch::addLabelRoute(LabelRouteBulkContext& ctx, const NextHopGroupKey
465465
Label& label = ctx.label;
466466

467467
/* next_hop_id indicates the next hop id or next hop group id of this route */
468-
sai_object_id_t next_hop_id;
468+
sai_object_id_t next_hop_id = SAI_NULL_OBJECT_ID;
469469
bool blackhole = false;
470470

471471
if (m_syncdLabelRoutes.find(vrf_id) == m_syncdLabelRoutes.end())

0 commit comments

Comments
 (0)