This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: -Wconversion


> So it warns you whenever you write a prototype that causes
> different argument conversion than the default.  That includes
> no conversion at all.

Ok.

> We don't put it in -Wtraditional because the warning triggers for
> legitimate code and there's no way to get rid of it.  For instance, it
> will complain about every function in <math.h> that takes float rather
> than double arguments (sinf, cosf, etc.)  -Wconversion is not intended
> for day-to-day use; -Wtraditional is.

I thought -Wtraditional only was intended for code that is
translated from traditional C to C89.

> The purpose of -Wconversion is to shake out bugs introduced when you
> add prototypes to a program that did not have them.

I still think this is confusing. -Wconversion seems to has more
than one purpose. For example:

     Also, warn if a negative integer constant expression is implicitly
     converted to an unsigned type.  For example, warn about the
     assignment `x = -1' if `x' is unsigned.  But do not warn about
     explicit casts like `(unsigned) -1'.

This has nothing to do with prototypes and is intreresting for
day-to-day use.

Isn't it better to have two different warnings? One intended for
day-to-day use and one intended for programs with prototypes
rencenlty added.

--
Patrik Hägglund

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]