Skip to content

cmd/cgo: cannot convert from type *_Ctype_char to type _Ctype_HANDLE (1.18 regression) #51726

Closed
@josharian

Description

@josharian

This code compiled on Windows with Go 1.17, but not with Go 1.18:

package p

/*
#include <windows.h>
*/
import "C"

func Error() {
	var x *C.char
	_ = C.HLOCAL(x)
}

The error message is:

p.go:10:15: cannot convert x (variable of type *_Ctype_char) to type _Ctype_HANDLE

Reverting 635e493 allows the code to compile again.

cc @eliasnaur @randall77 @dsnet @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.SoonThis needs action soon. (recent regressions, service outages, unusual time-sensitive situations)release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions