Skip to content

cmd/vet: eliminate "might be too small" shift warnings #19321

@josharian

Description

@josharian
func f(i int) int {
  return i >> 32
}

vet warns that i might be too small for a shift of 32. This happens for all machine-dependent types: int, uint, uintptr. This is a significant source of false positives in the standard library. We should instead look at the actual size on the platform being vetted, and complain definitively or not at all.

Related: #18085

cc @valyala @robpike

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeSuggestedIssues that may be good for new contributors looking for work to do.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions