Skip to content

Commit 0238fd8

Browse files
committed
cgo: arrange for English error messages
Fixes #21. R=r https://golang.org/cl/155048
1 parent 0911913 commit 0238fd8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/cmd/cgo/main.go

+5
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,11 @@ func main() {
5252
fatal("unknown architecture %s", arch)
5353
}
5454

55+
// Clear locale variables so gcc emits English errors [sic].
56+
os.Setenv("LANG", "en_US.UTF-8");
57+
os.Setenv("LC_ALL", "C");
58+
os.Setenv("LC_CTYPE", "C");
59+
5560
p := openProg(input);
5661
for _, cref := range p.Crefs {
5762
// Convert C.ulong to C.unsigned long, etc.

0 commit comments

Comments
 (0)