From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24844 invoked by alias); 14 Oct 2011 13:59:16 -0000 Received: (qmail 24836 invoked by uid 22791); 14 Oct 2011 13:59:15 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mga14.intel.com (HELO mga14.intel.com) (143.182.124.37) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 Oct 2011 13:58:53 +0000 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga102.ch.intel.com with ESMTP; 14 Oct 2011 06:58:53 -0700 X-ExtLoop1: 1 Received: from azsmsx603.amr.corp.intel.com ([10.2.161.23]) by azsmga001.ch.intel.com with ESMTP; 14 Oct 2011 06:58:53 -0700 Received: from azsmsx604.amr.corp.intel.com (10.2.161.34) by azsmsx603.amr.corp.intel.com (10.2.161.23) with Microsoft SMTP Server (TLS) id 8.2.255.0; Fri, 14 Oct 2011 06:58:52 -0700 Received: from azsmsx502.amr.corp.intel.com ([10.2.121.75]) by azsmsx604.amr.corp.intel.com ([10.2.161.34]) with mapi; Fri, 14 Oct 2011 06:58:52 -0700 From: "Iyer, Balaji V" To: Ian Lance Taylor CC: "'gcc@gcc.gnu.org'" Date: Fri, 14 Oct 2011 17:34:00 -0000 Subject: RE: Question about default_elf_asm_named_section function Message-ID: <2950715866004049A240A2F9BB410E7315F4307932@azsmsx502.amr.corp.intel.com> References: <2950715866004049A240A2F9BB410E7315F42971CC@azsmsx502.amr.corp.intel.com> In-Reply-To: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg00224.txt.bz2 Can I submit a patch for it? Or is it a small thing that patch is not neces= sary? Thanks, Balaji V. Iyer. -----Original Message----- From: Ian Lance Taylor [mailto:iant@google.com]=20 Sent: Friday, October 14, 2011 12:38 AM To: Iyer, Balaji V Cc: 'gcc@gcc.gnu.org' Subject: Re: Question about default_elf_asm_named_section function "Iyer, Balaji V" writes: > This email is in reference to the "default_elf_asm_named_section" functi= on in the varasm.c file.=20 > > This function is defined like this: > > void > default_elf_asm_named_section (const char *name, unsigned int flags, > tree decl ATTRIBUTE_UNUSED) > > > But, inside the function, there is this if-statement: > > > if (HAVE_COMDAT_GROUP && (flags & SECTION_LINKONCE)) > { > if (TREE_CODE (decl) =3D=3D IDENTIFIER_NODE) > fprintf (asm_out_file, ",%s,comdat", IDENTIFIER_POINTER (decl= )); > else > fprintf (asm_out_file, ",%s,comdat", > IDENTIFIER_POINTER (DECL_COMDAT_GROUP (decl))); > } > > > The decl is set with "ATTRIBUTE_UNUSED" but the if-statement is using "de= cl." Should we remove the attribute unused tag near the "tree decl" or is t= he if-statement a deadcode that should never be ? ATTRIBUTE_UNUSED does not mean "this parameter is never used." It means "t= his parameter may not be used." The difference is due to #ifdefs--if a par= ameter is only used in code that is something #ifdef'ed out, then the param= eter should be marked as ATTRIBUTE_UNUSED. In this case the parameter is always used, so we might as well remove the A= TTRIBUTE_UNUSED. Ian