[Mesa-dev] [PATCH] amd/addrlib: Rename the GB_ADDR_CONFIGs to GB_ADDR_CONFIG_{SI, GFX9}

Nicholas Miell nmiell at gmail.com
Wed Sep 27 18:56:42 UTC 2017


On 09/27/2017 11:53 AM, Nicolai Hähnle wrote:
> On 27.09.2017 20:42, Nicholas Miell wrote:
>> Giving the same name to two different types violates the C++ One 
>> Definition
>> Rule and gcc will complain about it in LTO builds.
> 
> Oh my. What does the gcc warning look like? (I assume it's just a warning.)
> 

[5/5] Linking target src/amd/vulkan/libvulkan_radeon.so.
../src/amd/addrlib/inc/chip/gfx9/gfx9_gb_reg.h:39:7: warning: type ‘union GB_ADDR_CONFIG’ violates the C++ One Definition Rule [-Wodr]
 union GB_ADDR_CONFIG {
       ^
../src/amd/addrlib/inc/chip/r800/si_gb_reg.h:92:3: note: a different type is defined in another translation unit
 } GB_ADDR_CONFIG;
   ^
../src/amd/addrlib/inc/chip/gfx9/gfx9_gb_reg.h:74:7: note: the first difference of corresponding definitions is field ‘bitfields’
     } bitfields, bits;
       ^
../src/amd/addrlib/inc/chip/r800/si_gb_reg.h:90:25: note: a field with different name is defined in another translation unit
      unsigned int val : 32;

> Since these are auto-generated headers which are very much standardized 
> inside AMD, I'm hesitant to apply this particular patch. Certainly there 
> can't be a bug here in reality, since those are just dumb unions.
> 
> I think internally we'd rather want a namespace-based solution. Any 
> ideas? I need to reflect on this a bit...
> 
> Thanks,
> Nicolai


More information about the mesa-dev mailing list