Skip to content

Commit 1474440

Browse files
committed
Fix build error from -Werror, -Wdangling-gsl
The prior version could return a different value every call.
1 parent 07ce95e commit 1474440

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

base/cvd/build_version.h.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@
2222
namespace android {
2323
namespace build {
2424

25-
constexpr std::string_view GetBuildNumber() {
26-
return "@VCS_TAG@";
25+
inline std::string_view GetBuildNumber() {
26+
static constexpr char kBuildNumber[] = "@VCS_TAG@";
27+
return kBuildNumber;
2728
}
2829

2930
} // namespace build

0 commit comments

Comments
 (0)