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: generates wrong C types for complex number parameters when using clang #8694

Closed
dane-unltd opened this issue Sep 10, 2014 · 3 comments

Comments

@dane-unltd
Copy link

commented Sep 10, 2014

What does 'go version' print?
go version default darwin/amd64

What steps reproduce the problem?

run the following program (go run main.go)
http://play.golang.org/p/WOFiz3zeyb

What happened?

I get warnings of the form

./main.go:35:3: warning: plain '_Complex' requires a type specifier; assuming '_Complex
double'
/usr/include/complex.h:37:17: note: expanded from macro 'complex'

and in main.cgo2.c the following definition

void
_cgo_7d1638001027_Cfunc_add(void *v)
{
 struct {
 complex p0;
 complex p1;
 complex r;
 } __attribute__((__packed__)) *a = v;
 a->r = add(a->p0, a->p1);
}

What should have happened instead?

On linux I get 'complex float' for the arguments instead and no warnings.
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 10, 2014

Comment 1:

Happens for me on GNU/Linux when I set CC=clang.

Labels changed: added repo-main, release-go1.4.

Status changed to Accepted.

@gopherbot

This comment has been minimized.

Copy link

commented Sep 24, 2014

Comment 2:

CL https://golang.org/cl/143570043 mentions this issue.
@rsc

This comment has been minimized.

Copy link
Contributor

commented Sep 24, 2014

Comment 3:

This issue was closed by revision 5917692.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015

@rsc rsc removed the release-go1.4 label Apr 14, 2015

@golang golang locked and limited conversation to collaborators Jun 25, 2016

wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 25, 2018
wheatman added a commit to wheatman/go-akaros that referenced this issue Jun 26, 2018
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 9, 2018
wheatman added a commit to wheatman/go-akaros that referenced this issue Jul 30, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants
You can’t perform that action at this time.