Hi,

In autoconf-2.69/lib/autoconf/go.m4, two of the test Go programs do the
following to open a file for output:

  f, err := os.Open("conftest.out", os.O_CREATE|os.O_WRONLY, 0777)

However, os.Open has changed in recent versions of Go. In Go 1 as
implemented in GCC 4.7, it only takes one argument. Compare:
  http://web.archive.org/web/20100210113321/http://golang.org/pkg/os/#File.Open
  http://web.archive.org/web/20110520214350/http://golang.org/pkg/os/#File.Open

So currently autoconf-2.69's testsuite fails on a machine with GCC 4.7:
the go.at test finds gccgo but can't compile anything with it. It works
if you change both of those calls to do:

  f, err := os.Create("conftest.out")

(e.g. with the attached patch) but that then won't work with older
versions of GCC. I'm not sure what the best fix would be here.

Thanks,

-- 
Adam Sampson <a...@offog.org>                         <http://offog.org/>
os.Open doesn't exist in multi-argument form in recent versions of Go.

diff -x config.log -x config.status -ru tmp/autoconf-2.69/lib/autoconf/go.m4 
work/autoconf-2.69/lib/autoconf/go.m4
--- tmp/autoconf-2.69/lib/autoconf/go.m4        2012-01-21 13:46:39.000000000 
+0000
+++ work/autoconf-2.69/lib/autoconf/go.m4       2012-04-26 12:55:17.535998327 
+0100
@@ -61,7 +61,7 @@
 # Produce source that performs I/O.
 m4_define([_AC_LANG_IO_PROGRAM(Go)],
 [AC_LANG_PROGRAM([import ( "fmt"; "os" )],
-[f, err := os.Open("conftest.out", os.O_CREATE|os.O_WRONLY, 0777)
+[f, err := os.Create("conftest.out")
  if err != nil {
        fmt.Println(err)
        os.Exit(1)
@@ -107,7 +107,7 @@
        "os"
 )
 ],
-[f, err := os.Open("conftest.val", os.O_CREATE|os.O_WRONLY, 0777)
+[f, err := os.Create("conftest.val")
  if err != nil {
        os.Exit(1)
  }

Reply via email to