Skip to content

[diff.library] Entry for abs incompatibility #9035

@eisenwave

Description

@eisenwave

The following code has undefined behavior in C++, but is well-defined in C:

abs(LLONG_MIN);

This happens because in C++, abs is overloaded and dispatches to llabs,
whereas in C, LLONG_MIN yields zero when converted to int when calling int abs(int).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2-BugPresentational errors and omissions

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions