From ac25adb8d491342fc5fd4e189c58b79be6f5835a Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Sat, 13 Apr 2024 11:57:35 -0700 Subject: Fix Privileges warnings After splitting up the compile units, warnings start showing up on the console about privileges. This is due to them being a static global, and not shared between the compile units. Move the array to a constexpr structure so that all compile units see the same init. Change-Id: I6e035342a5b229a0601c02092ca3ce665b14bbdb Signed-off-by: Ed Tanous --- redfish-core/include/privileges.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'redfish-core') diff --git a/redfish-core/include/privileges.hpp b/redfish-core/include/privileges.hpp index 8b4220847b..1225cdf806 100644 --- a/redfish-core/include/privileges.hpp +++ b/redfish-core/include/privileges.hpp @@ -45,7 +45,7 @@ enum class PrivilegeType }; /** @brief A fixed array of compile time privileges */ -constexpr std::array basePrivileges{ +constexpr std::array basePrivileges{ "Login", "ConfigureManager", "ConfigureComponents", "ConfigureSelf", "ConfigureUsers"}; @@ -60,7 +60,7 @@ constexpr const size_t maxPrivilegeCount = 32; * "hostconsole" user group. This privilege is required to access the host * console. */ -static const std::array privilegeNames{ +constexpr std::array privilegeNames{ "Login", "ConfigureManager", "ConfigureComponents", "ConfigureSelf", "ConfigureUsers", "OpenBMCHostConsole"}; @@ -102,7 +102,7 @@ class Privileges { if (!setSinglePrivilege(privilege)) { - BMCWEB_LOG_CRITICAL("Unable to set privilege {}in constructor", + BMCWEB_LOG_CRITICAL("Unable to set privilege {} in constructor", privilege); } } -- cgit v1.2.3