[Mesa-dev] [PATCH mesa] vma/tests: cast away implementation detail of using strtoul()

Dylan Baker dylan at pnwbakers.com
Thu Jun 7 02:25:30 UTC 2018

Yeah, Scott and I thought that went to the list before I did an offer the shoulder review, then realized it didn't after pushing.

On June 6, 2018 10:31:38 AM PDT, Eric Anholt <eric at anholt.net> wrote:
>Eric Engestrom <eric.engestrom at intel.com> writes:
>> On MacOS, the build fails because of a compiler complaint about
>> a downcast:
>>   vma_random_test.cpp:239:18: error: non-constant-expression cannot
>be narrowed from type 'unsigned long' to 'uint_fast32_t' (aka 'unsigned
>int') in initializer list [-Wc++11-narrowing]
>>      random_test r{seed};
>>                    ^~~~
>>   vma_random_test.cpp:239:18: note: insert an explicit cast to
>silence this issue
>>      random_test r{seed};
>>                    ^~~~
>>                    static_cast<uint_fast32_t>( )
>> Let's take the compiler's suggestion, as we only needed a long here
>> use strtoul().
>> Cc: Scott D Phillips <scott.d.phillips at intel.com>
>> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
>This commit seems to have resolved the issue:
>commit 08535dd8860951ce4572cd2590e417a1f3d96b3d
>Author: Scott D Phillips <scott.d.phillips at intel.com>
>Date:   Tue Jun 5 09:29:43 2018 -0700
>    util/tests/vma: Fix warning c++11-narrowing
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20180606/22d4b8c5/attachment.html>

More information about the mesa-dev mailing list