Remove some tautological comparisons involving rlim_t

Clang on macOS warns about these with -Wtautological-compare.  POSIX
guarantees that rlim_t is
unsigned (cf.
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html),
so these resource limits can never be negative.

* src/emacs.c (main): Remove tautological comparisons.
This commit is contained in:
Philipp Stephani 2017-06-14 12:35:58 +02:00
parent ac649dc4b4
commit 32d8dba625

View file

@ -832,7 +832,7 @@ main (int argc, char **argv)
(https://www.cygwin.com/ml/cygwin/2015-07/msg00096.html). */
struct rlimit rlim;
if (getrlimit (RLIMIT_STACK, &rlim) == 0
&& 0 <= rlim.rlim_cur && rlim.rlim_cur <= LONG_MAX)
&& rlim.rlim_cur <= LONG_MAX)
{
rlim_t lim = rlim.rlim_cur;
@ -866,7 +866,7 @@ main (int argc, char **argv)
right thing anyway. */
long pagesize = getpagesize ();
newlim += pagesize - 1;
if (0 <= rlim.rlim_max && rlim.rlim_max < newlim)
if (rlim.rlim_max < newlim)
newlim = rlim.rlim_max;
newlim -= newlim % pagesize;