[Openais] [PATCH corosync] totemsrp: remove unnecessary cast to avoid "make syntax-check" failure

Steven Dake sdake at redhat.com
Sun Jun 21 11:06:01 PDT 2009


I tested your patch on solaris and darwin no warning.  Must have been
confused about the 1000000000's of casts I've fixed :)

good for commit

regards
-steve


On Sun, 2009-06-21 at 19:59 +0200, Jim Meyering wrote:
> Steven Dake wrote:
> > On Sun, 2009-06-21 at 18:59 +0200, Jim Meyering wrote:
> ...
> >> diff --git a/exec/totemsrp.c b/exec/totemsrp.c
> >> index f0501a9..94bb37b 100644
> >> --- a/exec/totemsrp.c
> >> +++ b/exec/totemsrp.c
> >> @@ -4023,7 +4023,7 @@ static int message_handler_memb_join (
> >>  	int endian_conversion_needed)
> >>  {
> >>  	const struct memb_join *memb_join;
> >> -	struct memb_join *memb_join_convert = (struct memb_join *)alloca (msg_len);
> >> +	struct memb_join *memb_join_convert = alloca (msg_len);
> >>  	int gather_entered;
> >>
> >>  	if (endian_conversion_needed) {
> >> --
> >> 1.6.3.2.448.g363bdb
> >
> > This returns a warning on solaris which is why I made the change to cast
> > it.
> 
> Hi Steve,
> 
> Which compiler+options and which version of Solaris?
> I've had uses of alloca like that in coreutils
> for ages with no warnings, afaik.
> 
> E.g, on Solaris 5.10, with /bin/cc I get none:
> 
>     $ cat k.c
>     #include <alloca.h>
>     int main() { struct foo { int a; }; struct foo *p = alloca (5); return 0; }
>     $ cc k.c
>     $
> 
> > I am aware of the limitations of alloca but we have no way to handle
> > failure in this part of the code.



More information about the Openais mailing list