From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 120703 invoked by alias); 20 Dec 2016 23:56:06 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 120683 invoked by uid 89); 20 Dec 2016 23:56:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=3,4, wrapped, H*f:sk:7f11b7b, H*i:sk:87vaueu X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Dec 2016 23:56:03 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7C19B81F07; Tue, 20 Dec 2016 23:56:02 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uBKNu1KT004704; Tue, 20 Dec 2016 18:56:01 -0500 Subject: Re: [RFA 7/8] Use unique_xmalloc_ptr in execute_gdb_command To: Tom Tromey References: <1480395946-10924-1-git-send-email-tom@tromey.com> <1480395946-10924-8-git-send-email-tom@tromey.com> <878ts2yi5m.fsf@tromey.com> <87inqletsw.fsf@tromey.com> <7f11b7bb-bebb-1cd3-1e92-266638272443@redhat.com> <87vaueuqoh.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <819d6d1b-1afb-277c-3bf4-e8cc5884ac43@redhat.com> Date: Tue, 20 Dec 2016 23:56:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <87vaueuqoh.fsf@tromey.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-12/txt/msg00366.txt.bz2 On 12/20/2016 11:27 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> -extern struct cleanup *prevent_dont_repeat (void); > Pedro> +extern scoped_restore_tmpl prevent_dont_repeat (); > > Probably this should use __attribute__((warn_unused_result)), but that > isn't wrapped in ansidecl.h (yet) and I don't know offhand what version > test to use for it. Do you? Good idea. Looks like it's GCC 3.4. glibc has: /* If fortification mode, we warn about unused results of certain function calls which can lead to problems. */ #if __GNUC_PREREQ (3,4) # define __attribute_warn_unused_result__ \ __attribute__ ((__warn_unused_result__)) # if __USE_FORTIFY_LEVEL > 0 # define __wur __attribute_warn_unused_result__ # endif #else # define __attribute_warn_unused_result__ /* empty */ #endif #ifndef __wur # define __wur /* Ignore */ #endif Grepping my F23's system headers I see other hits for GCC 3.4: /usr/include/lzma.h:237: /* warn_unused_result was added in GCC 3.4. */ /usr/include/llvm/Support/Compiler.h:125:#if __has_attribute(warn_unused_result) || LLVM_GNUC_PREREQ(3, 4, 0) /usr/include/llvm/Support/Compiler.h:126:#define LLVM_ATTRIBUTE_UNUSED_RESULT __attribute__((__warn_unused_result__)) Thanks, Pedro Alves