[Mesa-dev] [PATCH 19/23] intel/eu: Fix up various type conversions in brw_eu.c that are illegal C++.

Francisco Jerez currojerez at riseup.net
Wed Jun 27 01:13:08 UTC 2018


Kenneth Graunke <kenneth at whitecape.org> writes:

> On Monday, June 11, 2018 7:26:11 PM PDT Francisco Jerez wrote:
>> diff --git a/src/intel/compiler/brw_eu.c b/src/intel/compiler/brw_eu.c
>> index 6ef0a6a577c..80f05240b42 100644
>> --- a/src/intel/compiler/brw_eu.c
>> +++ b/src/intel/compiler/brw_eu.c
>> @@ -356,14 +356,14 @@ brw_disassemble(const struct gen_device_info *devinfo,
>>     bool dump_hex = (INTEL_DEBUG & DEBUG_HEX) != 0;
>>  
>>     for (int offset = start; offset < end;) {
>> -      const brw_inst *insn = assembly + offset;
>> +      const brw_inst *insn = (const brw_inst *)((char *)assembly + offset);
>
> This isn't standard C either, but void * math is a pretty common
> compiler extension that's been around forever.  Personally, I'd
> prefer that we keep using it, as it's much more readable.

*Shrug*, using void pointer arithmetic here will cause GCC to emit a
warning "pointer of type ‘void *’ used in arithmetic".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 227 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180626/80566ff8/attachment-0001.sig>


More information about the mesa-dev mailing list