Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/cgo: error message for an unexpected type does not include the line number #28069

Closed
bruceesmith opened this issue Oct 8, 2018 · 2 comments

Comments

@bruceesmith
Copy link

commented Oct 8, 2018

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)? 1.11.1

Does this issue reproduce with the latest release? Yes

What operating system and processor architecture are you using (go env)? linux/amd64

What did you do? In the linked file on play.golang.org, put the commented C code into ld.h, then run "go build" against the ld.go program

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best. ---> https://play.golang.org/p/Ey5ZbkqleNU

What did you expect to see?

Go 1.10 and earlier build the program without errors

What did you see instead?

bruce@calochilus:/tmp$ go build ld.go

command-line-arguments

-: unexpected: 16-byte float type - long double
bruce@calochilus:/tmp$

NOTE: if the "union {" line in ld.h and the matching "} value;" line are commented out, then "go build" succeeds.

@ianlancetaylor ianlancetaylor changed the title cgo: error message for an unexpected type does not include the line number cmd/cgo: error message for an unexpected type does not include the line number Oct 8, 2018

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Oct 8, 2018

Standalone test case:

package main

/*
typedef long double             SmiFloat128;

typedef struct SV {
    union {
        SmiFloat128         float128;
    } value;
} SV;
*/
import "C"

type ts struct {
	tv *C.SV
}

func main() {}
@gopherbot

This comment has been minimized.

Copy link

commented Dec 3, 2018

Change https://golang.org/cl/152158 mentions this issue: cmd/cgo: use a plausible position for typedef error messages

@gopherbot gopherbot closed this in 54cbc5b Dec 3, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.