Patchwork Add prototypes for wrapped libgcc calls

login
register
about
Submitter Myles Watson
Date 2009-10-29 15:04:53
Message ID <2831fecf0910290804j1b7d496ep60b35e5d097deb9b@mail.gmail.com>
Download mbox | patch
Permalink /patch/512/
State Accepted
Commit r4888
Headers show

Comments

Myles Watson - 2009-10-29 15:04:53
On Thu, Oct 29, 2009 at 2:38 AM, Stefan Reinauer <stepan@coresystems.de>wrote:

> Myles Watson wrote:
> > Signed-off-by: Myles Watson <mylesgw@gmail.com <mailto:mylesgw@gmail.com
> >>
> >
> > Thanks,
> > Myles
> I wouldn't move those, ... they're never ever going to be called by
> anyone. (explicitly)
>
How about this, then.  Either way silences these warnings:

src/lib/gcc.c:30: warning: no previous prototype for '__wrap___divdi3'
src/lib/gcc.c:31: warning: no previous prototype for '__wrap___udivdi3'
src/lib/gcc.c:32: warning: no previous prototype for '__wrap___moddi3'
src/lib/gcc.c:33: warning: no previous prototype for '__wrap___umoddi3'

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles
Stefan Reinauer - 2009-10-29 16:42:59
Myles Watson wrote:
>
>
> On Thu, Oct 29, 2009 at 2:38 AM, Stefan Reinauer
> <stepan@coresystems.de <mailto:stepan@coresystems.de>> wrote:
>
>     Myles Watson wrote:
>     > Signed-off-by: Myles Watson <mylesgw@gmail.com
>     <mailto:mylesgw@gmail.com> <mailto:mylesgw@gmail.com
>     <mailto:mylesgw@gmail.com>>>
>     >
>     > Thanks,
>     > Myles
>     I wouldn't move those, ... they're never ever going to be called by
>     anyone. (explicitly)
>
> How about this, then.  Either way silences these warnings:
>
> src/lib/gcc.c:30: warning: no previous prototype for '__wrap___divdi3'
> src/lib/gcc.c:31: warning: no previous prototype for '__wrap___udivdi3'
> src/lib/gcc.c:32: warning: no previous prototype for '__wrap___moddi3'
> src/lib/gcc.c:33: warning: no previous prototype for '__wrap___umoddi3'
>
Ah! Ok, you're of course right.

> Signed-off-by: Myles Watson <mylesgw@gmail.com <mailto:mylesgw@gmail.com>>
As opposed to our previous discussion, I think in this case your second
patch is nicer in this case, as these functions must never be called
directly but only through our gcc workaround wrapper.

Acked-by: Stefan Reinauer <stepan@coresystems.de>

Stefan
Myles Watson - 2009-10-29 16:52:54
> > Signed-off-by: Myles Watson <mylesgw@gmail.com <mailto:mylesgw@gmail.com
> >>
> As opposed to our previous discussion, I think in this case your second
> patch is nicer in this case, as these functions must never be called
> directly but only through our gcc workaround wrapper.
>
I agree.


> Acked-by: Stefan Reinauer <stepan@coresystems.de>
>
Rev 4888.

Thanks,
Myles

Patch

Index: svn/src/lib/gcc.c
===================================================================
--- svn.orig/src/lib/gcc.c
+++ svn/src/lib/gcc.c
@@ -22,9 +22,9 @@ 
  * compiler call specifies. Therefore we need a wrapper around those
  * functions. See gcc bug PR41055 for more information.
  */
-
 #define WRAP_LIBGCC_CALL(type, name) \
 	type __real_##name(type a, type b) __attribute__((regparm(0))); \
+	type __wrap_##name(type a, type b); \
 	type __wrap_##name(type a, type b) { return __real_##name(a, b); }
 
 WRAP_LIBGCC_CALL(long long, __divdi3)