[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 32d8dba: Remove some tautological comparisons invol
From: |
Philipp Stephani |
Subject: |
[Emacs-diffs] master 32d8dba: Remove some tautological comparisons involving rlim_t |
Date: |
Wed, 14 Jun 2017 06:36:51 -0400 (EDT) |
branch: master
commit 32d8dba625fc50ccbe28e35afcf1f0529d611e00
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>
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.
---
src/emacs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/emacs.c b/src/emacs.c
index da8df1b..08430de 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;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 32d8dba: Remove some tautological comparisons involving rlim_t,
Philipp Stephani <=