Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Redeclaration of regcache_register_status differs from previous declaration
@ 2012-09-28 11:27 selven
  2012-09-28 12:05 ` Pedro Alves
  0 siblings, 1 reply; 2+ messages in thread
From: selven @ 2012-09-28 11:27 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 2233 bytes --]

Hi, I've never submitted a patch to gdb before, I don't know how to do
this, and I searched the wiki couldn't find more info. I was trying to
compile gdb on aix

0|myuser@abox Downloads $ uname -a
AIX abox 1 6 00C2EE1A4C00

Was configuring with:
 ./configure --prefix=/home/myuser/chrooted --disable-option-checking
--disable-libada --disable-libssp --disable-build-with-cxx
--disable-ppl-version-check  --disable-cloog-version-check
--disable-objc-gc --enable-serial-configure --disable-maintainer-mode
--disable-stage1-checking --disable-werror --disable-sim

Which went fine , I did a make, which ended in:


"regcache.c", line 229.9: 1506-068 (W) Operation between types "signed
char*" and "unsigned char*" is not allowed.
"regcache.c", line 236.9: 1506-068 (W) Operation between types "signed
char*" and "unsigned char*" is not allowed.
"regcache.c", line 415.1: 1506-343 (S) Redeclaration of
regcache_register_status differs from previous declaration on line 66
of "regcache.h".
"regcache.c", line 415.1: 1506-050 (I) Return type "int" in
redeclaration is not compatible with the previous return type "enum
register_status".
"regcache.c", line 417.3: 1506-045 (S) Undeclared identifier __func__.
make: 1254-004 The error code from the last command is 1.

Currently:
gdb/regcache.c
 414 int
 415 regcache_register_status (const struct regcache *regcache, int regnum)

Definition in regcache.h:
gdb/regcache.h
 66 enum register_status regcache_register_status (const struct
regcache *regcache,
 67                                                int regnum);


Should be:
 414 enum register_status
 415 regcache_register_status (const struct regcache *regcache, int regnum)

(So i kinda decided to post a patch, which sounded awesome :p )
Patch:
--- regcache.c  2012-09-28 07:12:18.019876000 -0400
+++ regcache_fixed.c    2012-09-28 07:12:19.049855400 -0400
@@ -411,7 +411,7 @@
   return newbuf;
 }

-int
+enum register_status
 regcache_register_status (const struct regcache *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);




My sincere apologies if this shouldn't have been posted here.

--
Pirabarlen Cheenaramen | $3|v3n
L'escalier

/*memory is like prison*/ (user==selven)?free(user):user=malloc(sizeof(brain));

[-- Attachment #2: regcache_patch.diff --]
[-- Type: application/octet-stream, Size: 287 bytes --]

--- regcache.c	2012-09-28 07:12:18.019876000 -0400
+++ regcache_fixed.c	2012-09-28 07:12:19.049855400 -0400
@@ -411,7 +411,7 @@
   return newbuf;
 }
 
-int
+enum register_status
 regcache_register_status (const struct regcache *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Redeclaration of regcache_register_status differs from previous declaration
  2012-09-28 11:27 Redeclaration of regcache_register_status differs from previous declaration selven
@ 2012-09-28 12:05 ` Pedro Alves
  0 siblings, 0 replies; 2+ messages in thread
From: Pedro Alves @ 2012-09-28 12:05 UTC (permalink / raw)
  To: selven; +Cc: gdb-patches

On 09/28/2012 12:27 PM, selven wrote:
> Hi, I've never submitted a patch to gdb before, I don't know how to do
> this, 

See <http://sourceware.org/gdb/contribute/>.

> and I searched the wiki couldn't find more info.

Yeah, we certainly could do better here.

> I was trying to compile gdb on aix

> Currently:
> gdb/regcache.c
>  414 int
>  415 regcache_register_status (const struct regcache *regcache, int regnum)
> 
> Definition in regcache.h:
> gdb/regcache.h
>  66 enum register_status regcache_register_status (const struct
> regcache *regcache,
>  67                                                int regnum);
> 
> 
> Should be:
>  414 enum register_status
>  415 regcache_register_status (const struct regcache *regcache, int regnum)

Whoops.

> 
> (So i kinda decided to post a patch, which sounded awesome :p )

It is.  :-)  The AIX port is in need of TLC (particularly to adapt
it to modern interfaces).  It would be great of someone stepped up
to give it some.  ;-)

I've applied this for you.

Thanks!

2012-09-28  selven  <pcthegreat@gmail.com>

	Make definition match declaration.

	* regcache.c (regcache_register_status): Change return type to
	enum register_status.
---
 gdb/regcache.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/regcache.c b/gdb/regcache.c
index c716280..449f682 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -411,7 +411,7 @@ regcache_dup (struct regcache *src)
   return newbuf;
 }

-int
+enum register_status
 regcache_register_status (const struct regcache *regcache, int regnum)
 {
   gdb_assert (regcache != NULL);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-09-28 12:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-28 11:27 Redeclaration of regcache_register_status differs from previous declaration selven
2012-09-28 12:05 ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox