From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14234 invoked by alias); 16 Mar 2007 15:15:26 -0000 Received: (qmail 13936 invoked by uid 22791); 16 Mar 2007 15:15:24 -0000 X-Spam-Check-By: sourceware.org Received: from postal.cs.tamu.edu (HELO postal.cs.tamu.edu) (128.194.138.100) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 16 Mar 2007 15:15:15 +0000 Received: from soliton.cs.tamu.edu (vpn-11.cs.tamu.edu [128.194.150.11]) by postal.cs.tamu.edu (Postfix) with ESMTP id 3F88046DE68; Fri, 16 Mar 2007 10:15:14 -0500 (CDT) Received: by soliton.cs.tamu.edu (Postfix, from userid 1000) id 11A9F1AAD6; Fri, 16 Mar 2007 06:04:41 -0500 (CDT) To: =?iso-8859-1?q?Manuel_L=F3pez-Ib=E1=F1ez?= Cc: "Nathan Sidwell" , gcc-patches , "Joseph Myers" , "Richard Henderson" Subject: Re: [PING^2] [C/C++] PR c/4076 -Wunused doesn't warn about static function only called by itself References: <6c33472e0703030348h708532f2g4bcaa49db5d54627@mail.gmail.com> <6c33472e0703141452s325e18ax813ef65696656d18@mail.gmail.com> <45F918A4.8000002@codesourcery.com> <6c33472e0703160352g33bb8b78na852d4fc1530a8be@mail.gmail.com> From: Gabriel Dos Reis In-Reply-To: <6c33472e0703160352g33bb8b78na852d4fc1530a8be@mail.gmail.com> Date: Fri, 16 Mar 2007 15:29:00 -0000 Message-ID: <87abydcuuu.fsf@soliton.cs.tamu.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01133.txt.bz2 "Manuel L=F3pez-Ib=E1=F1ez" writes: | On 15/03/07, Nathan Sidwell wrote: | > Manuel L=F3pez-Ib=E1=F1ez wrote: | > | > > Index: gcc/cp/semantics.c | > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | > > --- gcc/cp/semantics.c (revision 122472) | > > +++ gcc/cp/semantics.c (working copy) | > > @@ -2852,7 +2852,8 @@ finish_id_expression (tree id_expression | > > if (TREE_CODE (first_fn) =3D=3D TEMPLATE_DECL) | > > first_fn =3D DECL_TEMPLATE_RESULT (first_fn); | > > | > > - if (!really_overloaded_fn (decl)) | > > + /* Recursive call does not count as usage. */ | > > + if (!really_overloaded_fn (decl) && decl !=3D current_functio= n_decl) | > > mark_used (first_fn); | > > | > > if (!template_arg_p | > | > what about the other mark_used earlier on in that function: | > | > if (scope) | > { | > decl =3D (adjust_result_of_qualified_name_lookup | > (decl, scope, current_class_type)); | > | > if (TREE_CODE (decl) =3D=3D FUNCTION_DECL) | > mark_used (decl); | > | > why not similarly protect that? the other c++ bits are ok. | > | > nathan |=20 | I could but I was not able to construct a case where it was necessary. | How can a static function make a scoped recursive call? ^^^^^^^^^^^^^^^^^^^^ I'm unclear about what you mean by that. -- Gaby