aboutsummaryrefslogtreecommitdiff
path: root/src/debug
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2016-11-02 19:41:01 -0400
committerRuss Cox <rsc@golang.org>2016-11-03 16:35:25 +0000
commitb2290229c23fed8e4a63241568e436b1daa1196f (patch)
tree70154d0138db58999240142ae134034ec5c85f65 /src/debug
parenta4a4d43028ba20ecec50ef761012d17800553cde (diff)
downloadgo-b2290229c23fed8e4a63241568e436b1daa1196f.tar.xz
cmd/cgo: add #line directives to avoid printing bogus references to Go source files
A bit contrived to come up with an example, but it happened in #15836, somehow. $ cat /tmp/x.go package main /* #include <stddef.h> int foo(void); int foo(void) { return 2; } #define int asdf */ import "C" func main() { println(C.foo()) } $ go run /tmp/x.go # command-line-arguments cgo-builtin-prolog:9:31: error: unknown type name 'asdf' <<<<< _GoString_ GoStringN(char *p, int l); ^ /tmp/x.go:12:13: note: expanded from macro 'int' #define int asdf ^ cgo-builtin-prolog:10:28: error: unknown type name 'asdf' <<<<< _GoBytes_ GoBytes(void *p, int n); ^ /tmp/x.go:12:13: note: expanded from macro 'int' #define int asdf ^ 2 errors generated. The two marked lines used to refer incorrectly to /tmp/x.go. Fixes #15836. Change-Id: I08ef60a53cfd148112fceb651eaf7b75d94a7a8d Reviewed-on: https://go-review.googlesource.com/32613 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/debug')
0 files changed, 0 insertions, 0 deletions