[go-nuts] Re: [security] Vulnerability in golang.org/x/net/html

2021-05-20 Thread ajstarks
thanks for the update. In future announcements it may be useful to include the command to perform the upgrade as in $ go get -u -v golang.org/x/net On Thursday, May 20, 2021 at 1:21:20 PM UTC-4 Filippo Valsorda wrote: > Hello gophers, > > Version v0.0.0-20210520170846-37e1c6afe023 of

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Ian Lance Taylor
On Thu, May 20, 2021 at 6:46 AM Aaron Epstein wrote: > > gcc > > Is there a way to see which version go is picking up? I have both 4.9.4 and > 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is there a > way to tell? With bash on Unix systems, run $(go env CC) --version

[go-nuts] [security] Vulnerability in golang.org/x/net/html

2021-05-20 Thread Filippo Valsorda
Hello gophers, Version v0.0.0-20210520170846-37e1c6afe023 of golang.org/x/net fixes a vulnerability in the golang.org/x/net/html package which could cause a denial of service. An attacker can craft an input to ParseFragment that would cause it to enter an infinite loop and never return. This

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Shulhan
On Thu, 20 May 2021 07:05:22 -0700 (PDT) Aaron Epstein wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved > this issue. > > Still would be good to know if it is possible to know which gcc go is > using... > As addition to Manlio reply, for more information about using

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Manlio Perillo
Note that you can explicitly tell go the C compiler to use, by setting the CC environment variable. As an example: go env -w CC=path-to-gcc4.9.4 Manlio On Thursday, May 20, 2021 at 4:05:22 PM UTC+2 slugge...@gmail.com wrote: > Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Aaron Epstein
Removing gcc 4.1.2 from PATH so it picked up 4.9.4 which resolved this issue. Still would be good to know if it is possible to know which gcc go is using... On Thursday, May 20, 2021 at 9:46:34 AM UTC-4 Aaron Epstein wrote: > gcc > > Is there a way to see which version go is picking up? I

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Aaron Epstein
gcc Is there a way to see which version go is picking up? I have both 4.9.4 and 4.1.2. I suspect it is picking up 4.1.2 and this is the cause, but is there a way to tell? On Thursday, May 20, 2021 at 9:36:57 AM UTC-4 Ian Lance Taylor wrote: > On Thu, May 20, 2021, 4:47 AM Aaron Epstein

Re: [go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Ian Lance Taylor
On Thu, May 20, 2021, 4:47 AM Aaron Epstein wrote: > > I am seeing a compiler error when building a shared c library from a go > program. The error is: > > GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go > # runtime/cgo > cc1: warnings being treated as errors > _cgo_export.c:6:

[go-nuts] Build error from pragma warnings when doing "go build -buildmode=c shared..."

2021-05-20 Thread Aaron Epstein
Hi, I am seeing a compiler error when building a shared c library from a go program. The error is: GO111MODULE=on go build -buildmode=c-shared -o mylib.so myfile.go # runtime/cgo cc1: warnings being treated as errors _cgo_export.c:6: warning: ignoring #pragma GCC diagnostic _cgo_export.c:7:

[go-nuts] Re: how to work around "go vet: possible misuse of unsafe.Pointer"?

2021-05-20 Thread Kn
I found this issue: https://github.com/golang/go/issues/41205. I found the answer, this conversation could be closed. On Thursday, May 20, 2021 at 3:39:28 PM UTC+8 Kn wrote: > So sorry I didn't get how to format the code in the edit window. > > On Thursday, May 20, 2021 at 3:37:35 PM UTC+8 Kn

[go-nuts] Re: how to work around "go vet: possible misuse of unsafe.Pointer"?

2021-05-20 Thread Kn
So sorry I didn't get how to format the code in the edit window. On Thursday, May 20, 2021 at 3:37:35 PM UTC+8 Kn wrote: > Hi, guys, I need to acess shared memory, so I write some code like this: > > ```go > func shmget(key int, size int, mode int) (int, error) { > shmId, _, ret :=

[go-nuts] how to work around "go vet: possible misuse of unsafe.Pointer"?

2021-05-20 Thread Kn
Hi, guys, I need to acess shared memory, so I write some code like this: ```go func shmget(key int, size int, mode int) (int, error) { shmId, _, ret := syscall.Syscall(syscall.SYS_SHMGET, uintptr(key), uintptr(size), uintptr(mode)) if ret != 0 { return 0, fmt.Errorf("shmget ret: %d", ret) }