Skip to content

Commit

Permalink
[ELF] Fix a gcc -Wextra warning
Browse files Browse the repository at this point in the history
Extracted from D61046.

warning: enumeral and non-enumeral type in conditional expression [-Wextra]

Cast SHF_ALLOC to avoid that.

llvm-svn: 359070
  • Loading branch information
MaskRay committed Apr 24, 2019
1 parent 5a23586 commit 7478085
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lld/ELF/LinkerScript.cpp
Expand Up @@ -887,8 +887,8 @@ void LinkerScript::adjustSectionsBeforeSorting() {
// in case it is empty.
bool IsEmpty = getInputSections(Sec).empty();
if (IsEmpty)
Sec->Flags =
Flags & ((Sec->NonAlloc ? 0 : SHF_ALLOC) | SHF_WRITE | SHF_EXECINSTR);
Sec->Flags = Flags & ((Sec->NonAlloc ? 0 : (uint64_t)SHF_ALLOC) |
SHF_WRITE | SHF_EXECINSTR);

if (IsEmpty && isDiscardable(*Sec)) {
Sec->Live = false;
Expand Down

0 comments on commit 7478085

Please sign in to comment.