Skip to content

VS 2019 gives compiler warning C26451 for UT Array #198

@guywyers

Description

@guywyers

Similar to issue 195 for UT Hash:

Warning C26451 Arithmetic overflow: Using operator '*' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '*' to avoid overflow (io.2).

It seems in this case it's the following line causing the warning:
#define _utarray_eltptr(a,j) ((void*)((a)->d + ((a)->icd.sz * (j))))

Doesn't seem to be dramatic, but would be nice to have it fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions