diff options
| author | Ian Lance Taylor <iant@golang.org> | 2025-02-26 15:04:20 -0800 |
|---|---|---|
| committer | Gopher Robot <gobot@golang.org> | 2026-02-28 16:19:01 -0800 |
| commit | 03d9d244049f393a03fb81d87fa9366903dc282b (patch) | |
| tree | 634c6f9fa5356ebbc948ee4ce18a161665ffd5be /src/runtime | |
| parent | 011e98af3b254cb78f7765aff5410fd085cf3e81 (diff) | |
| download | go-03d9d244049f393a03fb81d87fa9366903dc282b.tar.xz | |
runtime/cgo: build with C compiler option -std=gnu90
This will ensure we remain portable. We use gnu90 rather than c90
because c90 doesn't permit C++ style line comments, and that is just
too painful.
Change-Id: Ia0e52c4aa75493ceb3e8ce383cdd2ec85afa0bd2
Reviewed-on: https://go-review.googlesource.com/c/go/+/653138
Reviewed-by: Cherry Mui <cherryyz@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/runtime')
| -rw-r--r-- | src/runtime/cgo/cgo.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/runtime/cgo/cgo.go b/src/runtime/cgo/cgo.go index c90fb424ac..d356c19d3f 100644 --- a/src/runtime/cgo/cgo.go +++ b/src/runtime/cgo/cgo.go @@ -28,6 +28,12 @@ package cgo // Use -Wdeclaration-after-statement because some CI builds use it. #cgo CFLAGS: -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement +// Use -std=gnu90 to maintain portability; +// we don't use c90 because that doesn't permit C++ line comments, +// which is just too painful. +// We don't do it on windows-386 because it causes test failures. +#cgo (!windows||!386) CFLAGS: -std=gnu90 + #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS */ |
