[Mesa-dev] [PATCH v2 1/2] virgl: Fix a strict-aliasing violation in the encoder

Edward O'Callaghan funfunctor at folklore1984.net
Thu Dec 8 00:03:08 UTC 2016



On 12/08/2016 02:53 AM, Emil Velikov wrote:
> On 6 December 2016 at 22:34, Edward O'Callaghan
> <funfunctor at folklore1984.net> wrote:
>> On 12/07/2016 12:36 AM, Emil Velikov wrote:
>>> On 6 December 2016 at 11:30, Edward O'Callaghan
>>> <funfunctor at folklore1984.net> wrote:
>>>> As per the C spec, it is illegal to alias pointers to different
>>>> types. This results in undefined behaviour after optimization
>>>> passes, resulting in very subtle bugs that happen only on a
>>>> full moon..
>>>>
>>>> Use a memcpy() as a well defined coercion between the double
>>>> to uint64_t interpretations of the memory.
>>>>
>>>> V.2: Use static_assert() instead of assert().
>>>>
>>> The lowercase static_assert is a c11 feature. You want to use the all
>>> caps version.
>>> See commit 23d1799f7dd5f8d1e8aa9f4efa6b1a4ed45faaa0
>>
>> Hi Emil,
>>
>> Why? I from that commit it seems only Android would have trouble however
>> virgl nor svga would want to be enabled on that platform?
>>
>> Or is there something else I probably missed?
>>
> If there's a valid reason to require X or Y one must clearly point it
> out, rather than jumping on bandwagons because it's cool/one can/etc.
> Forcing X and Y [without justification] is disrespectful towards
> everyone, even fellow developers. It also leads distro maintainers to
> think that upstream does not give a sh*t about issues they are faced
> with - old compilers, other.
> 
> There are [hundreds of] thousands people using mesa many of which with
> their own quirky requirements. Please consider that for future.
> Esp. when it's a trivial change as this ;-)

Emil, I understand all that and I had already sent a v3 with the
required amendment before I replied here. As I am not trying to
'force'/'disrespect' anyone or anything, I asked purely to gain a better
understanding of the reasoning behind requested change.

I don't take things on gospel, no matter how high up the developer is or
however trivial the change may be, as it is my change it is then my
responsibility to fully understand any variation to the change I am
proposing.

Kindest Regards,
Edward.

> 
> Thanks
> Emil
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161208/51383ca3/attachment.sig>


More information about the mesa-dev mailing list