public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Include aarch32-tdep.h in aarch32-tdep.c
@ 2019-11-26 19:48 Simon Marchi
  0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2019-11-26 19:48 UTC (permalink / raw)
  To: gdb-cvs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 2519 bytes --]

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=23767560e57e43d7ce3e509835b91ef2eb7e0746

commit 23767560e57e43d7ce3e509835b91ef2eb7e0746
Author: Simon Marchi <simon.marchi@efficios.com>
Date:   Tue Nov 26 12:12:00 2019 -0500

    Include aarch32-tdep.h in aarch32-tdep.c
    
    The error below shows that aarch32-tdep.c is missing an include for
    aarch32-tdep.h, add it.
    
          CXX    aarch32-tdep.o
        /home/smarchi/src/binutils-gdb/gdb/aarch32-tdep.c: In function ‘const target_desc* aarch32_read_description()’:
        /home/smarchi/src/binutils-gdb/gdb/aarch32-tdep.c:27:1: error: no previous declaration for ‘const target_desc* aarch32_read_description()’ [-Werror=missing-declarations]
         aarch32_read_description ()
         ^~~~~~~~~~~~~~~~~~~~~~~~
    
    Putting the include of aarch32-tdep.h early in aarch32-tdep.c gives us
    an error about target_desc not being defined.  Indeed, aarch32-tdep.h
    uses target_desc without forward-declaring it or including the proper
    header.  Add a forward-declaration for it.
    
    gdb/ChangeLog:
    
    	* aarch32-tdep.c: Include aarch32-tdep.h.
    	* aarch32-tdep.h: Forward-declare struct target_desc.
    
    Change-Id: Ica4be4de0fbd7f22d56a29a40fbf0a31b5abdb16

Diff:
---
 gdb/ChangeLog      | 5 +++++
 gdb/aarch32-tdep.c | 3 +++
 gdb/aarch32-tdep.h | 2 ++
 3 files changed, 10 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b4d7eb7..6f6019c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2019-11-26  Simon Marchi  <simon.marchi@efficios.com>
+
+	* aarch32-tdep.c: Include aarch32-tdep.h.
+	* aarch32-tdep.h: Forward-declare struct target_desc.
+
 2019-11-26  Christian Biesinger  <cbiesinger@google.com>
 
 	* linux-nat.c (detach_one_lwp): Call safe_strerror instead of
diff --git a/gdb/aarch32-tdep.c b/gdb/aarch32-tdep.c
index 12d4641..5b082fc 100644
--- a/gdb/aarch32-tdep.c
+++ b/gdb/aarch32-tdep.c
@@ -16,6 +16,9 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "gdbsupport/common-defs.h"
+
+#include "aarch32-tdep.h"
+
 #include "gdbsupport/common-regcache.h"
 #include "arch/aarch32.h"
 
diff --git a/gdb/aarch32-tdep.h b/gdb/aarch32-tdep.h
index 7fcea0a..eb4c70c 100644
--- a/gdb/aarch32-tdep.h
+++ b/gdb/aarch32-tdep.h
@@ -18,6 +18,8 @@
 #ifndef AARCH32_TDEP_H
 #define AARCH32_TDEP_H
 
+struct target_desc;
+
 /* Get the AArch32 target description.  */
 
 const target_desc *aarch32_read_description ();


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-26 19:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-26 19:48 [binutils-gdb] Include aarch32-tdep.h in aarch32-tdep.c Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).