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: [fortran, patch] reduce noise of -Wconversion


Daniel Franke wrote:
> attached patch attempts to reduce amount of noise generated by -Wconversion.
>   

The changes make sense to me, however, I am wondering whether we need
some -Wconversion-extra option. The current -Wconversion option is very
verbose, but it allowed me to find bugs such as:

  double_var = sqrt(2.0)

where the RHS should be: "sqrt(2.0d0)". The current warning allows one
to find it (buried in tons of other messages) - but with the proposed
patch, this information is no longer available. I would like to get some
warning for (REAL/COMPLEX less precision) -> (REAL/COMPLEX higher
precision) back. I personally do not mind to have an extra option for
this. Thus, -Wall -Wextra finds both problems, but one can then be disabled.


I think regarding disabling, I like the new middle-end feature, which
prints the warning flag in squared brackets after the warning message
-fdiagnostics-show-option (enabled by default), e.g.
  foo.c:4:2: warning: 'j' is used uninitialized in this function
[-Wuninitialized]
and with -Werror:
  foo.c:4:2: error: 'j' is used uninitialized in this function
[-Werror=uninitialized]
And with -fno-diagnostics-show-option the [-W...] message is not printed.

Tobias


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