From owner-freebsd-current@FreeBSD.ORG Sun Dec 2 00:37:40 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BA68CBD0; Sun, 2 Dec 2012 00:37:40 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ob0-f182.google.com (mail-ob0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 0D50D8FC0C; Sun, 2 Dec 2012 00:37:39 +0000 (UTC) Received: by mail-ob0-f182.google.com with SMTP id 16so1901502obc.13 for ; Sat, 01 Dec 2012 16:37:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=xCBa46lPqmyKsB1ZJgBIIyPjKCXroEvIdIxX0NtXpOk=; b=dn3JIq16DQF9aoV2vG2kKW1w2VPRDZnRe4xvm6CQadAXBn3uWNKyEqU51cU2sKCZBq NaWz1a8/FXYkpP5w8zuY8c7X0llHwxYwEuQKwn47rOs+/COe/HyLzpebGYeFm/JopvRk vZl29nItGHCt6v2Ppwood7srkUQHD38V3ZK810kaB34y4EKmF3qVTBNEO/KNkEJHzUhj hiuPBHpRnRJ1uvELB54vpm6/N5o/VyO+5zKymmshQbux8XaX0woYe5Gc8sT+UKF2R037 4CKyT7OwhJ9NbL6xvCOgJ5Wtjfgn4jCGAQ1/tj9wu5aoBg70rnBa56Weat1Nb4V6RgUB P0fA== MIME-Version: 1.0 Received: by 10.182.2.169 with SMTP id 9mr1127311obv.66.1354408659416; Sat, 01 Dec 2012 16:37:39 -0800 (PST) Received: by 10.76.143.33 with HTTP; Sat, 1 Dec 2012 16:37:39 -0800 (PST) In-Reply-To: <50B9E47F.6070005@FreeBSD.org> References: <20120703102142.6554b10e.taku@tackymt.homeip.net> <50B9E47F.6070005@FreeBSD.org> Date: Sat, 1 Dec 2012 16:37:39 -0800 Message-ID: Subject: Re: A suspicious warning in sys/boot/zfs/zfsimpl.c From: Garrett Cooper To: Andriy Gapon Content-Type: text/plain; charset=ISO-8859-1 Cc: Taku YAMAMOTO , freebsd-current@freebsd.org, Dimitry Andric X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Dec 2012 00:37:41 -0000 On Sat, Dec 1, 2012 at 3:05 AM, Andriy Gapon wrote: > I believe that there is no actual problem there. It's probably bugs with clang dealing with alignment problems. These warnings (and others) go largely unnoticed because of the fact that -Werror isn't on on sys/boot. I filed kern/173932 for that and have been grinding away on warnings for the past couple days in my spare time -- with my local modifications sys/boot compiles with -Werror now with gcc, but not clang. Thanks, -Garrett /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:101:24: error: tentative definition of variable with internal linkage has incomplete non-array type 'struct zfsmount' [-Werror,-Wtentative-definition-incomplete-type] static struct zfsmount zfsmount; ^ /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:101:15: note: forward declaration of 'struct zfsmount' static struct zfsmount zfsmount; ^ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: In file included from /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:38: /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfssubr.c:207:9: error: cast from 'char *' to 'zio_eck_t *' (aka 'struct zio_eck *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] eck = (zio_eck_t *)((char *)data + size) - 1; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ===> lib/libpam/modules/pam_rhosts (all) In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: ===> usr.sbin/devinfo (all) `kldstat.o' is up to date. /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:876:28: error: cast from 'char *' to 'vdev_phys_t *' (aka 'struct vdev_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] vdev_phys_t *vdev_label = (vdev_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1043:7: error: cast from 'char *' to 'const struct uberblock *' increases required alignment from 1 to 4 [-Werror,-Wcast-align] up = (const struct uberblock *)upbuf; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1223:12: error: cast from 'char *' to 'const blkptr_t *' (aka 'const struct blkptr *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] indbp = (const blkptr_t *) dnode_cache_buf; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1262:7: error: cast from 'char *' to 'const mzap_phys_t *' (aka 'const struct mzap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] mz = (const mzap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1289:8: error: cast from 'uint16_t *' (aka 'unsigned short *') to 'zap_leaf_chunk_t *' (aka 'union zap_leaf_chunk *') increases required alignment from 2 to 4 [-Werror,-Wcast-align] nc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_name_chunk); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfsimpl.h:1139:3: note: expanded from macro 'ZAP_LEAF_CHUNK' ((zap_leaf_chunk_t *) \ ^~~~~~~~~~~~~~~~~~~~~~ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1300:9: error: cast from 'uint16_t *' (aka 'unsigned short *') to 'zap_leaf_chunk_t *' (aka 'union zap_leaf_chunk *') increases required alignment from 2 to 4 [-Werror,-Wcast-align] nc = &ZAP_LEAF_CHUNK(zl, nc->l_array.la_next); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfsimpl.h:1139:3: note: expanded from macro 'ZAP_LEAF_CHUNK' ((zap_leaf_chunk_t *) \ ^~~~~~~~~~~~~~~~~~~~~~ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1317:8: error: cast from 'uint16_t *' (aka 'unsigned short *') to 'zap_leaf_chunk_t *' (aka 'union zap_leaf_chunk *') increases required alignment from 2 to 4 [-Werror,-Wcast-align] vc = &ZAP_LEAF_CHUNK(zl, zc->l_entry.le_value_chunk); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfsimpl.h:1139:3: note: expanded from macro 'ZAP_LEAF_CHUNK' ((zap_leaf_chunk_t *) \ ^~~~~~~~~~~~~~~~~~~~~~ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1333:19: error: cast from 'char *' to 'zap_phys_t *' (aka 'struct zap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] zap_phys_t zh = *(zap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1343:15: error: cast from 'char *' to 'zap_phys_t *' (aka 'struct zap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] z.zap_phys = (zap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1353:12: error: cast from 'char *' to 'uint64_t *' (aka 'unsigned long long *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] ptrtbl = (uint64_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1370:14: error: cast from 'char *' to 'zap_leaf_phys_t *' (aka 'struct zap_leaf_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] zl.l_phys = (zap_leaf_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1388:8: error: cast from 'uint16_t *' (aka 'unsigned short *') to 'zap_leaf_chunk_t *' (aka 'union zap_leaf_chunk *') increases required alignment from 2 to 4 [-Werror,-Wcast-align] zc = &ZAP_LEAF_CHUNK(&zl, h); ^~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfsimpl.h:1139:3: note: expanded from macro 'ZAP_LEAF_CHUNK' ((zap_leaf_chunk_t *) \ ^~~~~~~~~~~~~~~~~~~~~~ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1394:9: error: cast from 'uint16_t *' (aka 'unsigned short *') to 'zap_leaf_chunk_t *' (aka 'union zap_leaf_chunk *') increases required alignment from 2 to 4 [-Werror,-Wcast-align] zc = &ZAP_LEAF_CHUNK(&zl, zc->l_entry.le_next); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../../cddl/boot/zfs/zfsimpl.h:1139:3: note: expanded from macro 'ZAP_LEAF_CHUNK' ((zap_leaf_chunk_t *) \ ^~~~~~~~~~~~~~~~~~~~~~ In file included from /store/freebsd/head/sys/boot/i386/zfsboot/zfsboot.c:151: /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1420:14: error: cast from 'char *' to 'uint64_t *' (aka 'unsigned long long *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] zap_type = *(uint64_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1446:7: error: cast from 'char *' to 'const mzap_phys_t *' (aka 'const struct mzap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] mz = (const mzap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1467:19: error: cast from 'char *' to 'zap_phys_t *' (aka 'struct zap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] zap_phys_t zh = *(zap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~ /store/freebsd/head/sys/boot/i386/zfsboot/../../zfs/zfsimpl.c:1475:15: error: cast from 'char *' to 'zap_phys_t *' (aka 'struct zap_phys *') increases required alignment from 1 to 4 [-Werror,-Wcast-align] z.zap_phys = (zap_phys_t *) zap_scratch; ^~~~~~~~~~~~~~~~~~~~~~~~~~ fatal error: too many errors emitted, stopping now [-ferror-limit=] ===> gnu/usr.bin/groff/src/roff (all) (cd /store/freebsd/head/rescue/rescue/../../sbin/kldunload && make -DRESCUE CRUNCH_CFLAGS=-DRESCUE DIRPRFX=rescue/rescue/kldunload/ depend && make -DRESCUE CRUNCH_CFLAGS=-DRESCUE DIRPRFX=rescue/rescue/kldunload/ kldunload.o) 20 errors generated. *** [zfsboot.o] Error code 1 1 error *** [all] Error code 2 1 error *** [all] Error code 2 1 error *** [all] Error code 2 1 error *** [sys.all__D] Error code 2