Skip to content

false negative for -Wshift-overflow #24657

@llvmbot

Description

@llvmbot
Bugzilla Link 24283
Version unspecified
OS Windows NT
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@Weverything

Extended Description

See r243241 for reference. http://llvm.org/viewvc/llvm-project?view=revision&revision=243241

% cat shift.c
#include <sys/types.h>

static const uint32_t kFlagSync  = 2 << 30;
static const uint32_t kFlagSync2 = 1 << 35;
% ./clang shift.c -Wshift-overflow
shift.c:4:38: warning: shift count >= width of type [-Wshift-count-overflow]
static const uint32_t kFlagSync2 = 1 << 35;

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillac++clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions