bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Avoidable warning in getdtable.c?


From: Reuben Thomas
Subject: Avoidable warning in getdtable.c?
Date: Sat, 10 Mar 2018 00:25:46 +0000

I get this warning:

getdtablesize.c:115:12: warning: comparison of 0 <= unsigned
expression is always true [-Wtautological-compare]
      && 0 <= lim.rlim_cur && lim.rlim_cur <= INT_MAX
         ~ ^  ~~~~~~~~~~~~

According to this Open Group reference page
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/sys/resource.h.html
:

rlim_t: Unsigned integer type used for limit values.

So could the test 0 <= lim.rlim_cur be removed? I looked at the
communications around the introduction of that line, and I can't see
any suggestion that rlim_t is signed in any case.

-- 
https://rrt.sc3d.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]