From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25434 invoked by alias); 18 Feb 2013 19:41:09 -0000 Received: (qmail 25396 invoked by uid 22791); 18 Feb 2013 19:41:08 -0000 X-SWARE-Spam-Status: No, hits=-3.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-ob0-f172.google.com (HELO mail-ob0-f172.google.com) (209.85.214.172) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 Feb 2013 19:41:03 +0000 Received: by mail-ob0-f172.google.com with SMTP id tb18so5967672obb.3 for ; Mon, 18 Feb 2013 11:41:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:x-originating-ip:in-reply-to:references :date:message-id:subject:from:to:cc:content-type:x-gm-message-state; bh=b8eWkRXAt0iDkeaLTEJYp48UVnMdRY/ozhC5PC59w7c=; b=nJ3SBxe02ygqjDhbN2uRMslfxXVm9sDnQbmU54RXVx57yyW3M2EilZ8+APyBAoYfzC ziezHoI+LWlx5EM3F9jcff42QlNr5uK/cL0QXUk4dTtPAempuxd5MbZnqGFKSB2wsCx5 cz3V++/90qTu8xluyWB5OOtk9KgAI7aSNGnM5mSyBlrVelq6e6jrko3jLVo0/GYKOH/u vWNxylviJ0rNamy5kcB2NxvUuUFmAdq6Pa0rZLJwyDgItv2vqoa7MJczn833H5D4oFLj +1nB1S8saf+5Ys9Hvgx6lFnXKx8PREKTrG+XYt3S1rN4KFNq837810rQrd6GFBPzfB7Q JACA== MIME-Version: 1.0 X-Received: by 10.182.217.10 with SMTP id ou10mr6471099obc.30.1361216462507; Mon, 18 Feb 2013 11:41:02 -0800 (PST) Received: by 10.76.93.37 with HTTP; Mon, 18 Feb 2013 11:41:02 -0800 (PST) In-Reply-To: <51227F2E.5060103@twiddle.net> References: <87r4khnbqm.fsf@kepler.schwinge.homeip.net> <51227F2E.5060103@twiddle.net> Date: Mon, 18 Feb 2013 19:41:00 -0000 Message-ID: Subject: Re: Usage of __attribute__used__ in (system) headers? From: "Carlos O'Donell" To: Richard Henderson Cc: Thomas Schwinge , libc-alpha@sourceware.org, libc-ports@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlp3kPvQsveJMqczDIP3MFx5a4FmikCPcH8uIGFXEey7mtdkTj/IvS8fUmdxDpSKWh/5zoQ X-IsSubscribed: yes Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org X-SW-Source: 2013-02/txt/msg00036.txt.bz2 On Mon, Feb 18, 2013 at 2:21 PM, Richard Henderson wrote: > On 02/18/2013 11:00 AM, Carlos O'Donell wrote: >>> > static union { unsigned char __c[4]; float __d; } __nan_union >>> > - __attribute_used__ = { __nan_bytes }; >>> > + = { __nan_bytes }; >>> > # define NAN (__nan_union.__d) >>> > >>> > #endif /* GCC. */ >> I disagree, it's useful to mark the non-GCC version with >> an __attribute_used__ such that in the future we might >> use another compiler without problems. > > The annotation should not be attribute used at all, but rather unused. > > Used says that the object is referenced in some non-visible way by > assembly, and thus cannot be elided. Unused says that we understand the > variable may not be referenced, and don't warn; but do, in particular, > remove it if it is unused. Yes, thanks for catching that, honestly I forget that it's a "possibly unused" in that case. glibc doesn't have an __attribute_unused__. I'd be happy to review a patch that adds it and fixes up the 8 references to the bare attribute. Cheers, Carlos.