[Patch, Fortran] PR37420 - Fix -Wunused-variable.

Tobias Burnus burnus@net-b.de
Wed Sep 10 17:45:00 GMT 2008


H.J. Lu wrote:
> I am testing this patch. I will check it in if it can build libgfortran again.
>   
It should be enough to get libgfortran working again; however, I think
it is better to silence the warning by doing an assignment as I did in
Rev. 140237.
> --- libgfortran/mk-sik-inc.sh.unused	2008-01-17 09:09:59.000000000 -0800
> +++ libgfortran/mk-sik-inc.sh	2008-09-10 09:36:29.000000000 -07000
>   
I have admittedly forgotten that file (which is now broken), but that
did not cause any bootstrap failures. :-/

I plan to fix that file as well by applying the following patch (still
testing).

Somehow I believe mk*.sh should fail is no kind is available as this
indicates a some kind of build/compile problem.

Tobias

Index: mk-srk-inc.sh
===================================================================
--- mk-srk-inc.sh       (Revision 140238)
+++ mk-srk-inc.sh       (Arbeitskopie)
@@ -7,6 +7,7 @@

 for k in $possible_kinds; do
   echo "  real (kind=$k) :: x" > tmp$$.f90
+  echo "  x = 1.0_$k" >> tmp$$.f90
   echo "  end" >> tmp$$.f90
   if $compile -S tmp$$.f90 > /dev/null 2>&1; then
     kinds="$kinds $k"
Index: mk-sik-inc.sh
===================================================================
--- mk-sik-inc.sh       (Revision 140238)
+++ mk-sik-inc.sh       (Arbeitskopie)
@@ -7,6 +7,7 @@

 for k in $possible_kinds; do
   echo "  integer (kind=$k) :: x" > tmp$$.f90
+  echo "  x = 1_$k" >> tmp$$.f90
   echo "  end" >> tmp$$.f90
   if $compile -S tmp$$.f90 > /dev/null 2>&1; then
     kinds="$kinds $k"



More information about the Gcc-patches mailing list