From owner-freebsd-toolchain@FreeBSD.ORG Thu Nov 3 10:45:23 2011 Return-Path: Delivered-To: freebsd-toolchain@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 9A6F51065670; Thu, 3 Nov 2011 10:45:23 +0000 (UTC) Date: Thu, 3 Nov 2011 10:45:23 +0000 From: Alexander Best To: freebsd-toolchain@freebsd.org Message-ID: <20111103104523.GA30132@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: state of clang(1)'s -Wshift-count-negative and -Wshift-overflow warnings X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2011 10:45:23 -0000 hi there, i think the following warnings were discussed once before: In file included from /usr/git-freebsd-head/sys/dev/ath/ath_hal/ah_regdomain.c:99: /usr/git-freebsd-head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:69:15: warning: shift count is negative [-Wshift-count-negative] .chan11a = BM4(F1_4950_4980, ^~~~~~~~~~~~~~~~~ /usr/git-freebsd-head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:41:4: note: expanded from macro 'BM4' W1(_fa) | W1(_fb) | W1(_fc) | W1(_fd) } ^ /usr/git-freebsd-head/sys/dev/ath/ath_hal/ah_regdomain/ah_rd_domains.h:34:45: note: expanded from macro 'W1' (((_a) > 63 && (_a) < 128 ? (((uint64_t) 1)<<((_a)-64)) : (uint64_t) 0)) and /usr/git-freebsd-head/sys/dev/ath/ath_hal/ar5210/ar5210_power.c:36:3: warning: signed shift result (0x200000000) requires 35 bits to represent, but 'int' only has 32 bits [-Wshift-overflow] OS_REG_RMW_FIELD(ah, AR_SCR, AR_SCR_SLE, AR_SCR_SLE_ALLOW); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/git-freebsd-head/sys/dev/ath/ath_hal/ah_internal.h:471:42: note: expanded from macro 'OS_REG_RMW_FIELD' (OS_REG_READ(_a, _r) &~ (_f)) | (((_v) << _f##_S) & (_f))) ^ /usr/git-freebsd-head/sys/dev/ath/ah_osdep.h:127:49: note: expanded from macro 'OS_REG_WRITE' (bus_space_handle_t)(_ah)->ah_sh, (_reg), (_val)) iirc, back then, it was labeled as a clang bug. however testing with clang tot, i still get those warnings. so i just wanted to ask again, whether the warnings are really bogus, or if these warnings actually indicate issues during shifting? cheers. alex