[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: warning: comparison is always false due to limited range of data typ
From: |
Jim Meyering |
Subject: |
Re: warning: comparison is always false due to limited range of data type |
Date: |
Tue, 21 Jun 2005 15:59:46 +0200 |
"Oskar Liljeblad" <address@hidden> wrote:
> What's the proper way to fix these warnings?
>
> quotearg.c: In function `quotearg_n_options':
> quotearg.c:586: warning: comparison is always false due to limited range of
> data type
Paul, if you don't find a way to eliminate the warning by changing
xalloc_oversized itself (I didn't), how about using this change?
Index: quotearg.c
===================================================================
RCS file: /fetish/cu/lib/quotearg.c,v
retrieving revision 1.45
diff -u -p -r1.45 quotearg.c
--- quotearg.c 14 May 2005 07:58:07 -0000 1.45
+++ quotearg.c 21 Jun 2005 13:51:29 -0000
@@ -581,7 +581,7 @@ quotearg_n_options (int n, char const *a
if (nslots <= n0)
{
- unsigned int n1 = n0 + 1;
+ size_t n1 = n0 + 1;
if (xalloc_oversized (n1, sizeof *slotvec))
xalloc_die ();
- warning: comparison is always false due to limited range of data type, Oskar Liljeblad, 2005/06/20
- Re: warning: comparison is always false due to limited range of data type,
Jim Meyering <=
- Re: warning: comparison is always false due to limited range of data type, Paul Eggert, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Jim Meyering, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Oskar Liljeblad, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Jim Meyering, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Oskar Liljeblad, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Jim Meyering, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Jim Meyering, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Paul Eggert, 2005/06/22
- Re: warning: comparison is always false due to limited range of data type, Jim Meyering, 2005/06/23