From patchwork Wed Mar 8 16:21:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 19480 Received: (qmail 78241 invoked by alias); 8 Mar 2017 16:21:21 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 78224 invoked by uid 89); 8 Mar 2017 16:21:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= 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; Wed, 08 Mar 2017 16:21:18 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (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 572A66AAC2 for ; Wed, 8 Mar 2017 16:21:19 +0000 (UTC) Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v28GLHGJ000442 for ; Wed, 8 Mar 2017 11:21:18 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [pushed] gdb: Fix ATTRIBUTE_NONNULL usage Date: Wed, 8 Mar 2017 16:21:15 +0000 Message-Id: <1488990075-25616-1-git-send-email-palves@redhat.com> Should fix the build failure with Clang mentioned at : In file included from ../../binutils-gdb/gdb/dwarf2read.c:72: ../../binutils-gdb/gdb/common/gdb_unlinker.h:35:35: error: '__nonnull__' attribute is invalid for the implicit this argument unlinker (const char *filename) ATTRIBUTE_NONNULL (1) ^ ~ ../../binutils-gdb/gdb/../include/ansidecl.h:169:48: note: expanded from macro 'ATTRIBUTE_NONNULL' # define ATTRIBUTE_NONNULL(m) __attribute__ ((__nonnull__ (m))) gdb/ChangeLog: 2017-03-08 Pedro Alves PR 21206 * common/gdb_unlinker.h (unlinker::unlinker): Attribute nonnull goes to argument 2, not 1. --- gdb/ChangeLog | 6 ++++++ gdb/common/gdb_unlinker.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 92847f7..ce37aa7 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2017-03-08 Pedro Alves + PR 21206 + * common/gdb_unlinker.h (unlinker::unlinker): Attribute nonnull + goes to argument 2, not 1. + +2017-03-08 Pedro Alves + PR cli/21218 * top.c (gdb_readline_wrapper): Avoid passing NULL to display_gdb_prompt. diff --git a/gdb/common/gdb_unlinker.h b/gdb/common/gdb_unlinker.h index 0f3b98a..e93fa79 100644 --- a/gdb/common/gdb_unlinker.h +++ b/gdb/common/gdb_unlinker.h @@ -32,7 +32,7 @@ class unlinker { public: - unlinker (const char *filename) ATTRIBUTE_NONNULL (1) + unlinker (const char *filename) ATTRIBUTE_NONNULL (2) : m_filename (filename) { gdb_assert (filename != NULL);