bug-gnulib
[Top][All Lists]
Advanced

[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: Wed, 22 Jun 2005 11:06:50 +0200

Paul Eggert <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> "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?
>
> 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 call to xalloc_die ()).
>
> My own experience is that that particular warning is more trouble
> than it's worth.

I agree.
Sometimes I forget and still type `-W -Wall', forgetting that this
type of warning comes from using gcc's -W option.
These days, I rarely use -W (and never use it with -Werror),
for precisely that reason.

> Is there some easy way to ask GCC to not generate
> that warning?

Don't use -W :-)




reply via email to

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