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] PR37420 - Fix -Wunused-variable.


On Wed, Sep 10, 2008 at 8:13 AM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Sep 9, 2008 at 11:07 AM, Tobias Burnus <burnus@net-b.de> wrote:
>> With the support for warning about unset result variables, printing a
>> warning about other unused variables got disabled. The solution is to
>> move sym->mark down.
>>
>> sym->mask = sym->result->mark is unneeded. If the function name = result
>> name then  sym->result is a pointer to sym and if not, then setting
>> sym->mask is not needed.
>>
>> Build and check-gfortran regtested on x86-64-linux.
>> OK for the trunk?
>>
>> Tobias
>>
>> 2008-09-09  Tobias Burnus  <burnus@net-b.de>
>>
>>        PR fortran/37420
>>        * trans-decl.c (get_proc_pointer_decl): Fix -Wunused-variable.
>>
>> 2008-09-09  Tobias Burnus  <burnus@net-b.de>
>>
>>        PR fortran/37420
>>        * gfortran.dg/warn_unused_var.f90: New test.
>>        * gfortran.dg/warn_unused_var.f90: Add cleanup-modules.
>>
>
> This may have broken gcc bootstrap. On Linux/x86, I got
>
>
> In file included from /export/gnu/src/gcc-work/gcc/libgfortran/fmain.c:1:
> /export/gnu/src/gcc-work/gcc/libgfortran/libgfortran.h:260:2: error:
> #error "GFC_INTEGER_4 should be available for the library to compile".
> In file included from /export/gnu/src/gcc-work/gcc/libgfortran/fmain.c:1:
>
>

I am testing this patch. I will check it in if it can build libgfortran again.

---
H.J.
---
--- libgfortran/mk-kinds-h.sh.unused	2008-01-17 09:09:59.000000000 -0800
+++ libgfortran/mk-kinds-h.sh	2008-09-10 09:36:26.000000000 -0700
@@ -2,7 +2,7 @@
 LC_ALL=C
 export LC_ALL

-compile="$1"
+compile="$1 -Wno-unused-variable"

 # Possible types must be listed in ascending order
 possible_integer_kinds="1 2 4 8 16"
--- 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 -0700
@@ -1,6 +1,6 @@
 #!/bin/sh

-compile="$1"
+compile="$1 -Wno-unused-variable"
 kinds=""
 possible_kinds="1 2 4 8 16"
 c=0
--- libgfortran/mk-srk-inc.sh.unused	2008-01-17 09:09:59.000000000 -0800
+++ libgfortran/mk-srk-inc.sh	2008-09-10 09:36:33.000000000 -0700
@@ -1,6 +1,6 @@
 #!/bin/sh

-compile="$1"
+compile="$1 -Wno-unused-variable"
 kinds=""
 possible_kinds="4 8 10 16"
 c=0


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