Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Mar 2013 10:34:19 -0700
From:      Adrian Chadd <adrian@freebsd.org>
To:        Dimitry Andric <dim@freebsd.org>
Cc:        freebsd-hackers@freebsd.org, Joerg Sonnenberger <joerg@britannica.bec.de>
Subject:   Re: clang - odd macro / conditional expansion behaviour?
Message-ID:  <CAJ-Vmo=8nUvuLCyGO9w_%2Bw1Tbx6PhTgjz8B3R4MPOgkfiG%2Bnmg@mail.gmail.com>
In-Reply-To: <D4060110-61CB-49E3-9064-2A3F1FBAC27D@freebsd.org>
References:  <CAJ-Vmonn1m_AMiJbxfGDM%2BXrpfF%2BLKunSeoUWgkF9QVaMKf5ew@mail.gmail.com> <D4060110-61CB-49E3-9064-2A3F1FBAC27D@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12 March 2013 00:52, Dimitry Andric <dim@freebsd.org> wrote:
> On Mar 12, 2013, at 04:17 , Adrian Chadd <adrian@freebsd.org> wrote:
>> In file included from
>> /usr/home/adrian/work/freebsd/ath/head/src/sys/modules/ath/../../contrib=
/sys/dev/ath/ath_hal/ar9300/ar9300_eeprom.c:21:
>> /usr/home/adrian/work/freebsd/ath/head/src/sys/modules/ath/../../contrib=
/sys/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=
/sys/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 <http://ll=
vm.org/bugs/show_bug.cgi?id=3D10030>, which has been languishing in LLVM's =
Bugzilla for a way too long time. :-(
>

Yup it is, and yup it looks like this.



adrian



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=8nUvuLCyGO9w_%2Bw1Tbx6PhTgjz8B3R4MPOgkfiG%2Bnmg>