Date: Mon, 20 Sep 2010 04:20:55 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212886 - head/sbin/growfs Message-ID: <201009200420.o8K4KtKn026514@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Mon Sep 20 04:20:55 2010 New Revision: 212886 URL: http://svn.freebsd.org/changeset/base/212886 Log: Unbreak the build on strong-aligned architectures (arm, ia64). Casting from (char *) to (struct ufs1_dinode *) changes the alignment requirement of the pointer and GCC does not know that the pointer is adequately aligned (due to malloc(3)), and warns about it. Cast to (void *) first to by-pass the check. Modified: head/sbin/growfs/growfs.c Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Sun Sep 19 21:56:41 2010 (r212885) +++ head/sbin/growfs/growfs.c Mon Sep 20 04:20:55 2010 (r212886) @@ -452,7 +452,7 @@ initcg(int cylno, time_t utime, int fso, bzero(iobuf, sblock.fs_bsize); for (i = 0; i < sblock.fs_ipg / INOPF(&sblock); i += sblock.fs_frag) { - dp1 = (struct ufs1_dinode *)iobuf; + dp1 = (struct ufs1_dinode *)(void *)iobuf; #ifdef FSIRAND for (j = 0; j < INOPB(&sblock); j++) { dp1->di_gen = random();
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009200420.o8K4KtKn026514>