[build] Address warnings in gcc 11 and 12.

TEST=local builds
Bug: https://github.com/dart-lang/sdk/issues/50645
Change-Id: If6cd26620feff06abd449be0f7d1dd1e620b8411
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/275841
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
Ryan Macnak 2022-12-15 17:36:39 +00:00 committed by Commit Queue
parent ff2d661d5b
commit f181b50249
2 changed files with 2 additions and 0 deletions

View file

@ -67,6 +67,7 @@ void CpuInfo::Cleanup() {
bool CpuInfo::FieldContains(CpuInfoIndices idx, const char* search_string) {
if (method_ == kCpuInfoCpuId) {
const char* field = CpuId::field(idx);
if (field == NULL) return false;
bool contains = (strstr(field, search_string) != NULL);
free(const_cast<char*>(field));
return contains;

View file

@ -640,6 +640,7 @@ const char* ImageWriter::SectionSymbol(ProgramSection section, bool vm) {
case ProgramSection::BuildId:
return kSnapshotBuildIdAsmSymbol;
}
UNREACHABLE();
return nullptr;
}