shill: dhcp: make kDHCPCDPathFormatLease a compile-time const
Switch kDHCPCDPathFormatLease from a |const char []| to a |constexpr
char []|. This guarantees that the constant is a compile-time
const in other modules.
The benefit of making this a compile-time const for other modules
is that we can re-enable the format-nonliteral warning, without
tripping up on the use of kDHCPCDPathFormatLease as an argument
to base::StringPrintf in dhcp_config.cc
The actual re-enabling of format-nonliteral will come in a later
CL, after I've fixed other places that cause the warning.
BUG=chromium:293668
TEST=unit tests
Change-Id: I9ad4f93600df91269644a8ed68503e07cacd7bbc
Reviewed-on: https://chromium-review.googlesource.com/197038
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
diff --git a/dhcp_provider.cc b/dhcp_provider.cc
index f92d585..ff76f1d 100644
--- a/dhcp_provider.cc
+++ b/dhcp_provider.cc
@@ -22,8 +22,7 @@
base::LazyInstance<DHCPProvider> g_dhcp_provider = LAZY_INSTANCE_INITIALIZER;
} // namespace
-const char DHCPProvider::kDHCPCDPathFormatLease[] =
- "var/lib/dhcpcd/dhcpcd-%s.lease";
+constexpr char DHCPProvider::kDHCPCDPathFormatLease[];
DHCPProvider::DHCPProvider()
: proxy_factory_(ProxyFactory::GetInstance()),