https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90665

            Bug ID: 90665
           Summary: undefined C type 'int' with gcc 9.1.0 on solaric
           Product: gcc
           Version: 9.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: go
          Assignee: ian at airs dot com
          Reporter: thorsten.knieling at googlemail dot com
                CC: cmang at google dot com
  Target Milestone: ---

I built gcc 9.1.0 on Solaris 11 (SPARC) from sources (GNU). The build went well
and CGO free Go code can be compiled and works.

With CGO code the gccgo build does not compile. go code referencing any C
standard type like C.int returns an error:

sh> go build ./...
./main.go:18:2: call of non-function C.f
./main.go:18:6: invalid conversion to C.int: undefined C type 'int'

Here is the simple example code which does not build.

package main

/*
#include <stdio.h>

void f(int i) {
  fprintf(stdout,"INT: %d\n",i);
}
*/
import "C"

import (
        "fmt"
)

func main() {
        // Simple C function call.
        C.f(C.int(1))
        fmt.Println("ABC")
}

Reply via email to