Re: [PATCH 2.4.31 9/9] gcc4: fix i386 struct_cpy() warnings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 12 Jun 2005 19:43:03 +0300, Denis Vlasenko wrote:
> > diff -rupN linux-2.4.31/include/asm-i386/string.h linux-2.4.31.gcc4-i386-struct_cpy-warnings/include/asm-i386/string.h
> > --- linux-2.4.31/include/asm-i386/string.h	2001-08-12 11:35:53.000000000 +0200
> > +++ linux-2.4.31.gcc4-i386-struct_cpy-warnings/include/asm-i386/string.h	2005-06-12 11:52:25.000000000 +0200
> > @@ -337,7 +337,7 @@ extern void __struct_cpy_bug (void);
> >  #define struct_cpy(x,y) 			\
> >  ({						\
> >  	if (sizeof(*(x)) != sizeof(*(y))) 	\
> > -		__struct_cpy_bug;		\
> > +		__struct_cpy_bug();		\
> >  	memcpy(x, y, sizeof(*(x)));		\
> >  })
> 
> 1) Don't you need a void __struct_cpy_bug(void) declaration before this
>    (as a matter of style, not correctness)?

Not any more than would the original version with the variable.
gcc4 doesn't complain.

> 2) Why __ ? It is not compiler- or library-special, why not
>    BUG_struct_cpy_different_sizes() or something like this?

Ask the original author. I'm just following existing practise.
(I only seek minimal changes to enable gcc4 support, I'm _not_
on a mission to "clean up" code.)

/Mikael
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux