[Mesa-dev] [PATCH 04/24] i965: Make 'dw1' and 'bits' unnamed structures in brw_reg.

Matt Turner mattst88 at gmail.com
Tue Nov 3 12:13:55 PST 2015


On Tue, Nov 3, 2015 at 12:09 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> On Tue, Nov 3, 2015 at 3:00 PM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Tue, Nov 3, 2015 at 5:48 AM, Francisco Jerez <currojerez at riseup.net> wrote:
>>> Matt Turner <mattst88 at gmail.com> writes:
>>>
>>>> Generated by
>>>>
>>>>    sed -i -e 's/\.bits\././g' *.c *.h *.cpp
>>>>    sed -i -e 's/dw1\.//g' *.c *.h *.cpp
>>>>
>>>> and then reverting changes to comments in gen7_blorp.cpp and
>>>> brw_fs_generator.cpp.
>>>>
>>>> There wasn't any utility offered by forcing the programmer to list these
>>>> to access their fields. Removing them will reduce churn in future
>>>> commits.
>>>>
>>>> This is C11 (and gcc has apparently supported it for sometime
>>>> "compatibility with other compilers")
>>>>
>>>> See https://gcc.gnu.org/onlinedocs/gcc/Unnamed-Fields.html
>>>
>>> This is also used from C++ source where anonymous structs are not part
>>> of any released standard.
>>
>> That is true. I have built this series with both clang-3.6 and
>> gcc-4.4.7. I don't think it's a problem.
>
> FWIW the min supported compiler by mesa is GCC 4.2. I believe this is
> the last pre-GPLv3 version, and used by the BSD's.
>
>   -ilia

That doesn't compile i965 anyway because we use boolean literals, and
also because Mesa uses cpuid.h. But, hacking around those things, I
don't see any evidence that gcc-4.2 isn't able to handle this code
anyway.


More information about the mesa-dev mailing list