This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [Patch, Fortran] PR 82018: -Wextra should imply -Wconversion-extra


Hi Thomas,

>> here is a small patch that enables -Wconversion-extra with -Wextra and
>> updates the documentation.
>
> I grepped for warn_conversion_extra and found 14 occurrences in the
> gfortran source tree.
>
> Are we sure we want to enable each of these warnings with -Wextra?

I'd say: Yes, why not. They're all similar in style, it seems. Which
one are you worried about, in particular?

AFAICS, these warnings will essentially be triggered on compile-time
constants, for which the compiler knows that they can be converted
e.g. from real to integer without change in value. For such constants,
I guess it is easy (and advisable) to change them.

If you're writing '2.0' and assign it to an integer, then you probably
just mean '2'. I'd say the warning is justified for such cases.

Cheers,
Janus


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