Re: clang - odd macro / conditional expansion behaviour?

2013-03-12 Thread Dimitry Andric
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/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) == 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. :-(

___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: clang - odd macro / conditional expansion behaviour?

2013-03-12 Thread Joerg Sonnenberger
On Mon, Mar 11, 2013 at 08:17:08PM -0700, Adrian Chadd wrote:
> I've hit this rather amusing clang behaviour:

I think you are hitting a variant of
http://llvm.org/bugs/show_bug.cgi?id=10030.

Joerg
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


dtrace: operands have incompatible types: "dmu_buf_t **" = "dmu_buf_t **"

2013-03-12 Thread Andriy Gapon

For your amusement:

= testcase.d =
dmu_buf_t **buf;
/* Remove the following line to defuse. */
bpobj_t *bpobj;

fbt::dmu_bonus_hold:entry
{
buf = args[3]; /* the error is about this line */
}
===

I think I know what's going on, but I am still making sure that that's true.

-- 
Andriy Gapon
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: clang - odd macro / conditional expansion behaviour?

2013-03-12 Thread Adrian Chadd
On 12 March 2013 00:52, Dimitry Andric  wrote:
> 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/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) == 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. :-(
>

Yup it is, and yup it looks like this.



adrian
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"