Bug#373802: Fwd: Bug#373802: FTBFS with GCC 4.2: cast from pointer to integer of different size

Neil Brown neilb at suse.de
Fri Jun 16 01:02:15 UTC 2006


On Thursday June 15, madduck at debian.org wrote:
> tags 373802 confirmed upstream
> thanks
> 
> Neil, this one's for you.. future compatibility and all that jazz.
> :)
> 
> ----- Forwarded message from Martin Michlmayr <tbm at cyrius.com> -----
> 
> Now it fails with the following error with GCC 4.2.  Fortunately, this
> is the only remaining problem.
> 
> > Automatic build of mdadm_2.4.1-6 on juist by sbuild/alpha 0.44
> ...
> > gcc -Wall -Werror -Wstrict-prototypes -DCONFFILE=\"/etc/mdadm/mdadm.conf\" -DCONFFILE2=\"/etc/mdadm.conf\" -ggdb -fno-strict-aliasing -Os -DSendmail=\""/usr/sbin/sendmail -t"\"   -c -o super1.o super1.c
> > cc1: warnings being treated as errors
> > super1.c: In function 'calc_sb_1_csum':
> > super1.c:118: warning: cast from pointer to integer of different size
> > super1.c:119: warning: cast from pointer to integer of different size
> > make[1]: *** [super1.o] Error 1
> 

Yes, fixed in 2.5.1 - thanks.


-----------------------------
Fix offsetof macro for 64bit hosts

### Diffstat output
 ./super1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff .prev/super1.c ./super1.c
--- .prev/super1.c	2006-06-16 10:52:10.000000000 +1000
+++ ./super1.c	2006-06-16 10:53:41.000000000 +1000
@@ -104,7 +104,7 @@ struct mdp_superblock_1 {
 #define	MD_FEATURE_ALL			(1|2|4)
 
 #ifndef offsetof
-#define offsetof(t,f) ((int)&(((t*)0)->f))
+#define offsetof(t,f) ((size_t)&(((t*)0)->f))
 #endif
 static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
 {




More information about the pkg-mdadm-devel mailing list