Skip to content

MSVC compiler: C4146: unary minus operator applied to unsigned type, result still unsigned #1198

@bitzer-tjo

Description

@bitzer-tjo

Hi

That change from '(~a + 1)' to '-a' makes the MSVC compile fail if SDL is enabled.

Image

We are using SDL option for many other reason.

Why is it changed to '-a' ?

Link: https://c.godbolt.org/z/7aMdf3s8a

Thomas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions