From: Philipp Stephani Date: Wed, 14 Jun 2017 10:35:58 +0000 (+0200) Subject: Remove some tautological comparisons involving rlim_t X-Git-Tag: emacs-26.0.90~521^2~75 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=32d8dba625fc50ccbe28e35afcf1f0529d611e00;p=emacs.git 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. --- diff --git a/src/emacs.c b/src/emacs.c index da8df1bf1c7..08430de6ca7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -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;