[ping] unreviewed patches for 4.4

Daniel Franke franke.daniel@gmail.com
Mon Feb 25 20:42:00 GMT 2008


On Tuesday 19 February 2008 11:06:48 FX wrote:
> > PRs 31463,  33950, 34296 - fix inconsistent warnings if function
> > return value is not set
> >     http://gcc.gnu.org/ml/fortran/2008-01/msg00355.html
>
> I think it would be good to hide them behind a warning option.
> -Wreturn-type is probably the best choice among existing options,
> although clearly not perfect. Maybe we should just bind it to -W or
> -Wall?

Attached patch binds the messages to -Wreturn-type. It is essentially 
identical to the one submitted before besides the code to recognize the 
warning-option in fortran.


gcc/fortran:
2008-02-25  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/31463
        PR fortran/33950
        PR fortran/34296
	* lang.opt: Added -Wreturn-type.
	* options.c (gfc_handle_option): Recognize -Wreturn-type.
        * trans-decl.c (gfc_trans_deferred_vars): Emit warnings for funtions
        where the result value is not set.
        (gfc_generate_function_code): Likewise.
        (generate_local_decl): Emit warnings for funtions whose RESULT
        variable is not set.

gcc/testsuite:
2008-02-25  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/31463
        * gfortran.dg/arrayio_11.f90: Fixed test.
        * gfortran.dg/arrayio_12.f90: Likewise.
        * gfortran.dg/module_read_1.f90: Added warning-directives.
        * gfortran.dg/pr32242.f90: Likewise.
        * gfortran.dg/result_in_spec_3.f90: Likewise.
        * gfortran.dg/use_12.f90: Likewise.
        * gfortran.dg/warn_function_without_result.f90 : New test.

After updating, bootstrapped and regression tested on i686-pc-linux-gnu.


> My second concern is your use of TREE_NO_WARNING: if another,
> unrelated warning is to be emitted about that function, my understand
> is that TREE_NO_WARNING will kill it altogether. I'm trying to see if
> there is a really-life situation where that might happen, but I'm
> pretty confident there is. 

Any more ideas here? =)
Otherwise, ok for trunk?

Regards
	Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function-return-type.patch
Type: text/x-diff
Size: 10259 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20080225/51f17020/attachment.bin>


More information about the Fortran mailing list