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
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@bruceesmith
Copy link

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
Copy link
Contributor

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() {}

@ianlancetaylor ianlancetaylor added the NeedsFix The path to resolution is known, but the work has not been done. label Oct 8, 2018
@ianlancetaylor ianlancetaylor added this to the Go1.12 milestone Oct 8, 2018
@gopherbot
Copy link
Contributor

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

@golang golang locked and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants