summaryrefslogtreecommitdiff
path: root/redfish-core
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-04-13 21:57:35 +0300
committerEd Tanous <ed@tanous.net>2024-04-15 18:25:52 +0300
commitac25adb8d491342fc5fd4e189c58b79be6f5835a (patch)
tree5b12d55641c58e3cb48c7c9846d93a3c1ad4c381 /redfish-core
parent87c449664e5375abb040af6fad63ef965c311bec (diff)
downloadbmcweb-ac25adb8d491342fc5fd4e189c58b79be6f5835a.tar.xz
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 <ed@tanous.net>
Diffstat (limited to 'redfish-core')
-rw-r--r--redfish-core/include/privileges.hpp6
1 files changed, 3 insertions, 3 deletions
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<const char*, 5> basePrivileges{
+constexpr std::array<std::string_view, 5> 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<std::string, maxPrivilegeCount> privilegeNames{
+constexpr std::array<std::string_view, maxPrivilegeCount> 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);
}
}