From 25800da2238f7bcd5cd272bbde9d6c8c8dbaf2f5 Mon Sep 17 00:00:00 2001 From: Mark Barolak Date: Tue, 11 Jul 2023 12:30:02 -0700 Subject: Add a comment to absl/flags/parse.cc indicating that the flags defined there are not intended to be read or set from C++ code. PiperOrigin-RevId: 547264846 Change-Id: Idd0958f308ec74f907c22cce965fac2e06692e2c --- absl/flags/parse.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'absl') diff --git a/absl/flags/parse.cc b/absl/flags/parse.cc index f41ddfcb..4cdd9d0a 100644 --- a/absl/flags/parse.cc +++ b/absl/flags/parse.cc @@ -99,6 +99,8 @@ struct SpecifiedFlagsCompare { ABSL_NAMESPACE_END } // namespace absl +// These flags influence how command line flags are parsed and are only intended +// to be set on the command line. Avoid reading or setting them from C++ code. ABSL_FLAG(std::vector, flagfile, {}, "comma-separated list of files to load flags from") .OnUpdate([]() { @@ -148,6 +150,8 @@ ABSL_FLAG(std::vector, tryfromenv, {}, absl::flags_internal::tryfromenv_needs_processing = true; }); +// Rather than reading or setting --undefok from C++ code, please consider using +// ABSL_RETIRED_FLAG instead. ABSL_FLAG(std::vector, undefok, {}, "comma-separated list of flag names that it is okay to specify " "on the command line even if the program does not define a flag " -- cgit v1.2.3