From 15c22686d0e33d87262bc9075296eeddd7d955f7 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Wed, 8 Mar 2017 15:52:16 +0000 Subject: [PATCH] gdb: Fix ATTRIBUTE_NONNULL usage 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 92847f72177..ce37aa79f6c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/gdb/common/gdb_unlinker.h b/gdb/common/gdb_unlinker.h index 0f3b98a54ff..e93fa79e167 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); -- 2.30.2