Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(298)

Issue 4082047: code review 4082047: cgo: improve error reporting slightly. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 1 month ago by rog
Modified:
14 years, 1 month ago
Reviewers:
CC:
iant, rsc, golang-dev
Visibility:
Public.

Description

cgo: improve error reporting slightly. If there were warnings or errors in the user code, cgo would print the first error from gcc and then stop, which is not helpful. This CL makes cgo ignore errors from user code in the first pass - they will be shown later. It also prints errors from user preamble code with the correct line numbers. (Also fixed misleading usage message).

Patch Set 1 #

Patch Set 2 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 3 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 4 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 5 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 6 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 7 : code review 4082047: cgo: improve error reporting slightly. #

Total comments: 1

Patch Set 8 : code review 4082047: cgo: improve error reporting slightly. #

Patch Set 9 : code review 4082047: cgo: improve error reporting slightly. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -12 lines) Patch
M src/cmd/cgo/ast.go View 1 2 3 4 5 6 2 chunks +11 lines, -4 lines 0 comments Download
M src/cmd/cgo/gcc.go View 1 2 3 2 chunks +1 line, -7 lines 0 comments Download
M src/cmd/cgo/main.go View 1 2 3 4 5 6 7 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 7
rog
Hello iant, rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 1 month ago (2011-01-28 12:22:35 UTC) #1
iant
LGTM but wait for Russ.
14 years, 1 month ago (2011-01-29 06:43:19 UTC) #2
rsc
Looks good except for taking away the part where the error shows the gcc input. ...
14 years, 1 month ago (2011-01-30 17:07:40 UTC) #3
rog
initially i added a verbose flag, but then i noticed the -debug-gcc flag and thought ...
14 years, 1 month ago (2011-01-30 17:29:54 UTC) #4
rsc
LGTM One minor fix (as you suggested). http://codereview.appspot.com/4082047/diff/17001/src/cmd/cgo/main.go File src/cmd/cgo/main.go (right): http://codereview.appspot.com/4082047/diff/17001/src/cmd/cgo/main.go#newcode102 src/cmd/cgo/main.go:102: os.Exit(2) flag.PrintDefaults() ...
14 years, 1 month ago (2011-01-30 21:17:48 UTC) #5
rog
Hello iant, rsc (cc: golang-dev@googlegroups.com), Please take another look.
14 years, 1 month ago (2011-01-31 09:07:56 UTC) #6
rsc
14 years, 1 month ago (2011-01-31 19:31:37 UTC) #7
*** Submitted as fcf755cfceb6 ***

cgo: improve error reporting slightly.
If there were warnings or errors in the user code,
cgo would print the first error from gcc and then stop,
which is not helpful.
This CL makes cgo ignore errors from user code
in the first pass - they will be shown later.
It also prints errors from user preamble code
with the correct line numbers.
(Also fixed misleading usage message).

R=iant, rsc
CC=golang-dev
http://codereview.appspot.com/4082047

Committer: Russ Cox <rsc@golang.org>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b