Skip to content

cmd/cgo: cannot build goyaml using clang #4857

@fsouza

Description

@fsouza
% go version
go version devel +dd18b993ba95 Wed Feb 20 12:34:16 2013 +0400 darwin/amd64
% echo $CC
/usr/local/bin/clang
% $CC --version
clang version 3.2 (tags/RELEASE_32/final)
Target: x86_64-apple-darwin12.2.0
Thread model: posix
% cd $GOPATH/src/launchpad.net/goyaml
% go build
# launchpad.net/goyaml
decode.go:34:7: warning: incompatible pointer types assigning to 'const struct
<anonymous struct at decode.go:32:9> *' from 'const struct <anonymous struct at
decode.go:34:16> *' [-Wincompatible-pointer-types]
        a->r = (const struct {yaml_char_t* anchor; }*) event_alias((void*)a->p0);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
decode.go:44:7: warning: incompatible pointer types assigning to 'const struct
<anonymous struct at decode.go:42:9> *' from 'const struct <anonymous struct at
decode.go:44:16> *' [-Wincompatible-pointer-types]
        a->r = (const struct {yaml_char_t* anchor; yaml_char_t* tag; int implicit; yaml_mapping_style_t style; }*) event_mapping_start((void*)a->p0);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
decode.go:54:7: warning: incompatible pointer types assigning to 'const struct
<anonymous struct at decode.go:52:9> *' from 'const struct <anonymous struct at
decode.go:54:16> *' [-Wincompatible-pointer-types]
        a->r = (const struct {yaml_char_t* anchor; yaml_char_t* tag; yaml_char_t* value; size_t length; int plain_implicit; int quoted_implicit; yaml_scalar_style_t style; }*) event_scalar((void*)a->p0);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
decode.go:64:7: warning: incompatible pointer types assigning to 'const struct
<anonymous struct at decode.go:62:9> *' from 'const struct <anonymous struct at
decode.go:64:16> *' [-Wincompatible-pointer-types]
        a->r = (const struct {yaml_char_t* anchor; yaml_char_t* tag; int implicit; yaml_sequence_style_t style; }*) event_sequence_start((void*)a->p0);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
# launchpad.net/goyaml
decode.go:139: p.event.start_mark undefined (type C.yaml_event_t has no field or method
start_mark)
decode.go:140: p.event.start_mark undefined (type C.yaml_event_t has no field or method
start_mark)
encode.go:49: e.emitter.open_ended undefined (type C.yaml_emitter_t has no field or
method open_ended)

I'm using CL 7351044, so all.bash pass. I'm able build some other cgo packages. clang
from tip reports the same errors.

It works with gcc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions