Skip to content

Signedness comparison issue #19

@Sidewinder1138

Description

@Sidewinder1138

Hey guys, I'm currently getting this error:

src/bstrlib/bstrlib.c: In function 'findreplaceengine':
src/bstrlib/bstrlib.c:1754:13: error: comparison of integer expressions of different signedness: 'int' and 'long long unsigned int' [-Werror=sign-compare]
if (mlen > (INT_MAX / sizeof(int *)) / 2) {

I cast mlen to unsigned and that works fine:

if ((unsigned)mlen > (INT_MAX / sizeof(int *)) / 2) {

But wondering what people think of this?

I'm on Windows 10 using MinGW-W64 8.1.0 with -Wall -Wextra -pedantic -Werror.

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