Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 887aaf4e authored by Yi Kong's avatar Yi Kong
Browse files

libcutils: Fix -Wtautological-constant-out-of-range-compare

The TEMP_FAILURE_RETRY macro was being used with a boolean expression,
which caused a tautological-constant-out-of-range-compare warning.

This change moves the comparison outside of the macro to fix the
warning.

Generated by Gemini.

system/core/libcutils/ashmem-dev.cpp:253:9: error: result of comparison of constant -1 with expression of type bool is always false [-Werror,-Wtautological-constant-out-of-range-compare]
  253 |         TEMP_FAILURE_RETRY(ioctl(fd, ASHMEM_SET_NAME, name) < 0) ||
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
bionic/libc/include/unistd.h:468:18: note: expanded from macro 'TEMP_FAILURE_RETRY'
  468 |     } while (_rc == -1 && errno == EINTR); \
      |              ~~~ ^  ~~

Bug: 72331526
Test: presubmit
Flag: EXEMPT, code cleanup
Change-Id: I78b714c991bc60dc6ed1051c4165d2c3cb5ccecd
parent e42dc806
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment