autoconf
[Top][All Lists]
Advanced

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

Re: AC_*/AM_* macros for options


From: Paul Eggert
Subject: Re: AC_*/AM_* macros for options
Date: Wed, 30 Oct 2013 18:29:45 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

Jeffrey Walton wrote:
> When Linux/Unix folks turn off
> -Wconversion, what do they use to find the bad conversions?

The projects I normally work with don't use any automated
tools.  Instead, code is written in such a way that bad
conversions are unlikely to happen.

For example, the Emacs developers avoid using unsigned types.
This avoids these bad conversions.

The coreutils developers write their code carefully.
Which they have to do anyway, for reasons that should be obvious.
This also works reasonably well.  Well enough so that almost
all the bad-conversion warnings are bogus, anyway.  I just
now compiled coreutils-8.21 with -Wconversion, got 1845
warnings, looked at the first 10, found that they were
all bogus, and gave up.  In one example, the code subtracted
two pointers that were into the same array and stored the
result into a size_t variable, and the compiler warned about
conversion from ptrdiff_t to size_t.  Which is a totally
bogus warning.

It's not worth my (or anybody else's) time to wade through
all those bogus messages.  We have lots better ways to
find bugs in coreutils than that.



reply via email to

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