xrprof icon indicating copy to clipboard operation
xrprof copied to clipboard

Range-related warnings when compiling on macOS

Open atheriel opened this issue 4 years ago • 0 comments

I get the following on an Intel mac:

src/xrprof.c:100:55: warning: result of comparison of constant -9223372036854775808 with expression of type 'pid_t' (aka 'int') is always false [-Wtautological-constant-out-of-range-compare]
      if ((errno == ERANGE && (pid == LONG_MAX || pid == LONG_MIN)) ||
                                                  ~~~ ^  ~~~~~~~~
src/xrprof.c:100:36: warning: result of comparison of constant 9223372036854775807 with expression of type 'pid_t' (aka 'int') is always false [-Wtautological-constant-out-of-range-compare]
      if ((errno == ERANGE && (pid == LONG_MAX || pid == LONG_MIN)) ||
                               ~~~ ^  ~~~~~~~~
2 warnings generated.

this may be a platform-specific issue or simply due to better compiler warnings under clang.

atheriel avatar Dec 10 '21 16:12 atheriel