From owner-freebsd-hackers@FreeBSD.ORG Tue Mar 12 07:52:12 2013 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E4FE7D; Tue, 12 Mar 2013 07:52:12 +0000 (UTC) (envelope-from dim@freebsd.org) Received: from tensor.andric.com (tensor.andric.com [IPv6:2001:7b8:3a7:1:2d0:b7ff:fea0:8c26]) by mx1.freebsd.org (Postfix) with ESMTP id 218B8EB7; Tue, 12 Mar 2013 07:52:12 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7::5090:4bd6:bcf8:9b4f] (unknown [IPv6:2001:7b8:3a7:0:5090:4bd6:bcf8:9b4f]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 5CE305C44; Tue, 12 Mar 2013 08:52:10 +0100 (CET) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: clang - odd macro / conditional expansion behaviour? From: Dimitry Andric In-Reply-To: Date: Tue, 12 Mar 2013 08:52:09 +0100 Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Adrian Chadd X-Mailer: Apple Mail (2.1499) Cc: freebsd-hackers@freebsd.org, Joerg Sonnenberger X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2013 07:52:12 -0000 On Mar 12, 2013, at 04:17 , Adrian Chadd wrote: > In file included from > = /usr/home/adrian/work/freebsd/ath/head/src/sys/modules/ath/../../contrib/s= ys/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:21: > = /usr/home/adrian/work/freebsd/ath/head/src/sys/modules/ath/../../contrib/s= ys/dev/ath/ath_hal/ar9300/ar9300template_generic.h:107:3: > error: implicit conversion from 'int' to > 'u_int8_t' (aka 'unsigned char') changes value from -477 to 35 > [-Werror,-Wconstant-conversion] > FREQ2FBIN(2412, 1), > ^~~~~~~~~~~~~~~~~~ > = /usr/home/adrian/work/freebsd/ath/head/src/sys/modules/ath/../../contrib/s= ys/dev/ath/ath_hal/ar9300/ar9300eep.h:136:65: > note: expanded from macro 'FREQ2FBIN' > (((y) =3D=3D HAL_FREQ_BAND_2GHZ) ? ((x) - 2300) : (((x) - 4800) / = 5)) > ~~~~~~~~~~~~~^~~ I cannot find the exact code you are referencing here, but I assume it = is some sort of global initialization? If so, this is most likely = , which has been = languishing in LLVM's Bugzilla for a way too long time. :-(