From 79479ac486c15ed5919773f1f28c1eecea19b8b9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 9 Dec 2013 10:33:27 -0500 Subject: [PATCH] cmd/dist, cmd/go: pass -fmessage-length=0 when using clang That option turns off word wrapping of individual error messages generated by clang. The wrapping makes the errors harder to read and conflicts with the idea of a terminal window that can be resized. R=golang-dev, r CC=golang-dev https://golang.org/cl/35810043 --- src/cmd/dist/build.c | 2 ++ src/cmd/go/build.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c index 69e2aafad9b..c70d5798db4 100644 --- a/src/cmd/dist/build.c +++ b/src/cmd/dist/build.c @@ -677,6 +677,8 @@ install(char *dir) vadd(&gccargs, "-fno-caret-diagnostics"); // clang is too smart about unused command-line arguments vadd(&gccargs, "-Qunused-arguments"); + // disable line wrapping in error messages + vadd(&gccargs, "-fmessage-length=0"); } if(streq(gohostos, "darwin")) { // golang.org/issue/5261 diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go index f70f778d942..7d6913662cb 100644 --- a/src/cmd/go/build.go +++ b/src/cmd/go/build.go @@ -1890,6 +1890,8 @@ func (b *builder) ccompilerCmd(envvar, defcmd, objdir string) []string { a = append(a, "-fno-caret-diagnostics") // clang is too smart about command-line arguments a = append(a, "-Qunused-arguments") + // disable word wrapping in error messages + a = append(a, "-fmessage-length=0") } // On OS X, some of the compilers behave as if -fno-common