Skip to content

Fails to build with Clang 10 due to -Werror #879

@jbeich

Description

@jbeich
$ CC=clang10 CXX=clang++10 cmake -GNinja /path/to/media-driver
$ ninja
[...]
media_driver/agnostic/common/os/mos_utilities.c:73:21: error: loop variable 'data' of type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::vector<PerfUtility::Tick, std::__1::allocator<PerfUtility::Tick> > *>' creates a copy from type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::vector<PerfUtility::Tick, std::__1::allocator<PerfUtility::Tick> > *>' [-Werror,-Wrange-loop-construct]
    for (const auto data : records)
                    ^
media_driver/agnostic/common/os/mos_utilities.c:73:10: note: use reference type 'const std::__1::pair<const std::__1::basic_string<char>, std::__1::vector<PerfUtility::Tick, std::__1::allocator<PerfUtility::Tick> > *> &' to prevent copying
    for (const auto data : records)
         ^~~~~~~~~~~~~~~~~
                    &
media_driver/agnostic/common/renderhal/renderhal.cpp:5221:73: error: expression does not compute the number of elements in this array; element type is 'short', not 'uint64_t' (aka 'unsigned long') [-Werror,-Wsizeof-array-div]
    dwCount         = sizeof(pKernelEntry->pCscParams->Matrix[0].Coeff) / sizeof(uint64_t);
                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
media_driver/agnostic/common/renderhal/renderhal.cpp:5221:73: note: place parentheses around the 'sizeof(uint64_t)' expression to silence this warning

Metadata

Metadata

Assignees

No one assigned

    Labels

    verifyingPR: fix ready and verifying with build/test

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions