]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: clarify help message for -L flag
authorRobert Griesemer <gri@golang.org>
Wed, 23 Mar 2022 20:29:43 +0000 (13:29 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 24 Mar 2022 03:55:46 +0000 (03:55 +0000)
The file names reported in error messages by the compiler are
printed unchanged from the file names provided to the compiler;
the -L flag has no impact on the file names themselves, contrary
to what the old flag description suggested.

If an error is reported on a line that is affected by a //line
directive, an error message reports the file name and line as
controlled by the directive (i.e., the actual source position
is not known).

If the -L flag is provided, the actual source position is also
reported in square brackets.

This change documents this with an updated help string for the
flag.

For #36988.

Change-Id: I39ee35e6ff6cd5cfa44d87dabb05b8d78575d631
Reviewed-on: https://go-review.googlesource.com/c/go/+/395115
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
src/cmd/compile/internal/base/flag.go

index 0056f83059e0c1ff661cf6499027e61ce8f9744c..49e004cf18599e94d84e4c32f842c6dcec276899 100644 (file)
@@ -58,7 +58,7 @@ type CmdFlags struct {
        E CountFlag    "help:\"debug symbol export\""
        I func(string) "help:\"add `directory` to import search path\""
        K CountFlag    "help:\"debug missing line numbers\""
-       L CountFlag    "help:\"show full file names in error messages\""
+       L CountFlag    "help:\"also show actual source file names in error messages for positions affected by //line directives\""
        N CountFlag    "help:\"disable optimizations\""
        S CountFlag    "help:\"print assembly listing\""
        // V is added by objabi.AddVersionFlag