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: documentation missing for C++ #6393

Closed
robpike opened this issue Sep 16, 2013 · 6 comments

Comments

@robpike
Copy link
Contributor

commented Sep 16, 2013

CL 8248043 implemented something but it is very poorly documented. The word C++ doesn't
even appear in doc.go.

This needs to be explained before the release. For instance, how does this functionality
compare with SWIG?
@rsc

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2013

Comment 1:

Labels changed: added documentation.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2013

Comment 2:

I believe that what that CL implemented is support for compiling .cc files and linking
them into the program. 
Cgo per se still does not know about C++, in that you cannot refer to C.cout or anything
like that. The new support only helps if you have a plain C header file implemented by
C++ code.
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2013

Comment 3:

What CL 8248043 did was, in effect, support using .cc files in much the same way we
support using .c files.  As far as I can tell we currently don't document the handling
of .c files at all.
It's not clear to me where this should be documented.  This isn't a part of the cgo tool
as such.  It's the go tool that picks up .c (and now .cc) files.  There is an
interaction between the go tool and the cgo tool that is not documented anywhere as far
as I know; the go tool treats .c files differently if the package uses cgo.
Here is what is new in 1.2: if a package uses cgo, then any .cc files will be compiled
with the C++ compiler and included in the package.  There is another change that is
probably not worth documenting: when linking a binary, if any package uses cgo and has a
.cc file, then the C++ compiler will be used as the external linker (external linking is
documented as part of cgo internals).
@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2013

Comment 4:

Owner changed to @ianlancetaylor.

Status changed to Started.

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2013

@ianlancetaylor

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2013

Comment 6:

This issue was closed by revision acae4d2.

Status changed to Fixed.

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

@rsc rsc removed the go1.2 label Apr 14, 2015

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

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.