Re: warning: comparison is always false due to limited range of data type

2005-09-01 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: >> Is it really permitted to have sizeof (size_t) < sizeof (unsigned int)? ... >> The offending warning breaks coreutils' `make distcheck' rule. > > Would it make sense to rewrite coreutils 'make distcheck' to filter

Re: warning: comparison is always false due to limited range of data type

2005-08-31 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > Is it really permitted to have sizeof (size_t) < sizeof (unsigned int)? Yes, I'm afraid so. The C Standard merely says that size_t is an unsigned integer type; size_t is allowed to be narrower than unsigned int. See, for example, Mark Brader's 10-year-o

Re: warning: comparison is always false due to limited range of data type

2005-08-31 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> Is there a patch yet to make gcc suppress that warning? > > Sorry, not yet. Other things are on my plate > >> - unsigned int n1 = n0 + 1; >> + /* FIXME: technically, the type of n1 should be `unsig

Re: warning: comparison is always false due to limited range of data type

2005-08-31 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > Is there a patch yet to make gcc suppress that warning? Sorry, not yet. Other things are on my plate > - unsigned int n1 = n0 + 1; > + /* FIXME: technically, the type of n1 should be `unsigned int', > + but that evokes an unsuppressi

Re: warning: comparison is always false due to limited range of data type

2005-08-31 Thread Jim Meyering
t in the expansion of xalloc_oversized]: > quotearg.c: In function `quotearg_n_options': > quotearg.c:586: warning: comparison is always false due to limited range of > data type In the meantime, I've just checked in this change in coreutils/lib: 2005-08-31 Jim Meyering &

Re: [bug-gnulib] Re: warning: comparison is always false due to limited range of data type

2005-07-11 Thread Bruno Haible
Paul Eggert wrote: > Shouldn't we simply fix GCC instead? I agree. The appended simpler test case (with 'unsigned short' instead of 'unsigned int', to see the warning on a 32-bit platform as well) produces the warning with "gcc -Wall", even without -W, with any of 3.3.1, 3.4.3, 4.0.0. It appears

Re: warning: comparison is always false due to limited range of data type

2005-06-23 Thread Jim Meyering
y fail. Something like this? > (completely untested): > > 2005-06-22 Paul Eggert <[EMAIL PROTECTED]> > > * xalloc.h: Work around a bogus GCC 4.0.0 warning "comparison is always > false due to limited range of data type". Problem rep

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Paul Eggert
Paul Eggert <[EMAIL PROTECTED]> * xalloc.h: Work around a bogus GCC 4.0.0 warning "comparison is always false due to limited range of data type". Problem reported by Oskar Liljeblad. (xalloc_lt, xalloc_lt_always_false): New macros. (x

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: >> "Oskar Liljeblad" <[EMAIL PROTECTED]> wrote: ... >>> quotearg.c: In function `quotearg_n_options': >>> quotearg.c:586: warning: comparison is always false due to limited range of >>> data type ...

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Jim Meyering
how turned on by default? > > $ gcc -DHAVE_CONFIG_H -I. -I. -I.. -g -O2 -c quotearg.c > quotearg.c: In function `quotearg_n_options': > quotearg.c:586: warning: comparison is always false due to limited range of > data type No. It was my fault. I'd changed it to size_t, th

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Oskar Liljeblad
unction `quotearg_n_options': quotearg.c:586: warning: comparison is always false due to limited range of data type $ gcc -DHAVE_CONFIG_H -I. -I. -I.. -c quotearg.c quotearg.c: In function `quotearg_n_options': quotearg.c:586: warning: comparison is always false due to limited range of data

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Jim Meyering
Oskar Liljeblad <[EMAIL PROTECTED]> wrote: > On Wednesday, June 22, 2005 at 11:50, Jim Meyering wrote: ... >> These days, I rarely use -W (and never use it with -Werror), >> for precisely that reason. > > I get that warning without both -W and -Wall, I think. > (gcc 3.3.6) I've tried with the foll

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Oskar Liljeblad
On Wednesday, June 22, 2005 at 11:50, Jim Meyering wrote: > > Isn't that a cure that is worse than the disease? That patch will > > slow down the code on his platform, by causing the compiler to insert > > a run-time check where it now does the check at compile-time (and can > > therefore omit the

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Jim Meyering
Paul Eggert <[EMAIL PROTECTED]> wrote: > Jim Meyering <[EMAIL PROTECTED]> writes: > >> "Oskar Liljeblad" <[EMAIL PROTECTED]> wrote: >>> What's the proper way to fix these warnings? >>> >>> quotearg.c: In function `quotearg_n_

Re: warning: comparison is always false due to limited range of data type

2005-06-22 Thread Paul Eggert
Jim Meyering <[EMAIL PROTECTED]> writes: > "Oskar Liljeblad" <[EMAIL PROTECTED]> wrote: >> What's the proper way to fix these warnings? >> >> quotearg.c: In function `quotearg_n_options': >> quotearg.c:586: warning: comparison is always

Re: warning: comparison is always false due to limited range of data type

2005-06-21 Thread Jim Meyering
"Oskar Liljeblad" <[EMAIL PROTECTED]> 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

warning: comparison is always false due to limited range of data type

2005-06-20 Thread Oskar Liljeblad
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 argp-help.c: In function `make_hol': argp-help.c:430: warning: comparison is always true due to limite