Skip to content

MSVC with AVX2 compile option, C4244 warnings. #3489

@ghost

Description

If build with AVX2 instruction set, MSVC has dozens of C4244 warnings:
warning C4244: 'return': conversion from 'unsigned __int64' to 'unsigned int', possible loss of data

MEM_STATIC unsigned ZSTD_countTrailingZeros64(U64 val)
{
    assert(val != 0);
#   if defined(_MSC_VER) && defined(_WIN64)
#       if STATIC_BMI2 == 1
            return _tzcnt_u64(val);
#       else

Adding (unsinged) before _tzcnt_u64(val) should fixes this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions