aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilipp Stephani2017-06-14 12:35:58 +0200
committerPhilipp Stephani2017-06-14 12:35:58 +0200
commit32d8dba625fc50ccbe28e35afcf1f0529d611e00 (patch)
treebc9aff8e2d44e7a2982b79e7d8562f91d3b41998 /src
parentac649dc4b48be3fab8c904012aca4c07b0019041 (diff)
downloademacs-32d8dba625fc50ccbe28e35afcf1f0529d611e00.tar.gz
emacs-32d8dba625fc50ccbe28e35afcf1f0529d611e00.zip
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.
Diffstat (limited to 'src')
-rw-r--r--src/emacs.c4
1 files changed, 2 insertions, 2 deletions
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)
832 (https://www.cygwin.com/ml/cygwin/2015-07/msg00096.html). */ 832 (https://www.cygwin.com/ml/cygwin/2015-07/msg00096.html). */
833 struct rlimit rlim; 833 struct rlimit rlim;
834 if (getrlimit (RLIMIT_STACK, &rlim) == 0 834 if (getrlimit (RLIMIT_STACK, &rlim) == 0
835 && 0 <= rlim.rlim_cur && rlim.rlim_cur <= LONG_MAX) 835 && rlim.rlim_cur <= LONG_MAX)
836 { 836 {
837 rlim_t lim = rlim.rlim_cur; 837 rlim_t lim = rlim.rlim_cur;
838 838
@@ -866,7 +866,7 @@ main (int argc, char **argv)
866 right thing anyway. */ 866 right thing anyway. */
867 long pagesize = getpagesize (); 867 long pagesize = getpagesize ();
868 newlim += pagesize - 1; 868 newlim += pagesize - 1;
869 if (0 <= rlim.rlim_max && rlim.rlim_max < newlim) 869 if (rlim.rlim_max < newlim)
870 newlim = rlim.rlim_max; 870 newlim = rlim.rlim_max;
871 newlim -= newlim % pagesize; 871 newlim -= newlim % pagesize;
872 872