Skip to content

cmd/cgo: -godefs mishandles enum value #39534

Closed
@ianlancetaylor

Description

@ianlancetaylor

Reduced test case:

package p

// enum { IFF_UP = 0x1 };
import "C"

const IFF_UP = C.IFF_UP

Running go tool cgo -godefs x.go with Go 1.14 produces

const IFF_UP = 0x1

With tip it produces

const IFF_UP = int32

Although -godefs is not seriously supported, we shouldn't break it like this.

This may be due to https://golang.org/cl/230037. CC @mdempsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions