Skip to content

Overflow in constant expressions not caught #3101

@llvmbot

Description

@llvmbot
Bugzilla Link 2729
Resolution FIXED
Resolved on Jan 16, 2014 14:53
Version unspecified
OS NetBSD
Reporter LLVM Bugzilla Contributor
CC @chengniansun,@efriedma-quic,@zygoloid,@rjmccall,@RealLitb

Extended Description

Constraint 6.6p4 in C99 requires constant expressions evaluate to values within the range of their type. The following violation of that constraint is accepted in pedantic-errors mode.

#include <limits.h>

enum { ns = -INT_MIN }; /* Overflow. */

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