[Bug fortran/29459] Spurious warnings about anonymous variables

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Aug 15 09:16:00 GMT 2007



------- Comment #9 from fxcoudert at gcc dot gnu dot org  2007-08-15 09:16 -------
OK, I've found the culprit: the variable is created in
gfc_trans_vla_one_sizepos(). However, it makes no sense to issue warnings about
anonymous variables, since these are emitted by the front-end for internal
business, and don't refer to user code. Thus, we can simply get rid of it as a
whole, with:

Index: trans.c
===================================================================
--- trans.c     (revision 127490)
+++ trans.c     (working copy)
@@ -102,7 +102,15 @@ remove_suffix (char *name, int len)
 tree
 gfc_create_var_np (tree type, const char *prefix)
 {
-  return create_tmp_var_raw (type, prefix);
+  tree t;
+  
+  t = create_tmp_var_raw (type, prefix);
+
+  /* No warnings for anonymous variables.  */
+  if (prefix == NULL)
+    TREE_NO_WARNING (t) = 1;
+
+  return t;
 }




-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
            Summary|Spurious warning about      |Spurious warnings about
                   |uninitialized optional      |anonymous variables
                   |arguments                   |
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29459



More information about the Gcc-bugs mailing list