Change unsafe.Pointer to be its own kind of
type, instead of making it equivalent to *any.
The change complicates import and export
but avoids the need to find all the places that
operate on pointers but should not operate on
unsafe.Pointer.
Fixes#1566. (a different way)
Fixes#1582.
R=ken2
CC=golang-dev
https://golang.org/cl/4264050
Also: renamed fixedbugs/bug322.go to fixedbugs/bug323.go
because we already have a bugs/bug322.go and bug322.dir.
R=rsc
CC=golang-dev
https://golang.org/cl/4219044
The recent linker changes broke NaCl support
a month ago, and there are no known users of it.
The NaCl code can always be recovered from the
repository history.
R=adg, r
CC=golang-dev
https://golang.org/cl/3671042
cc: same
runtime: test cc alignment (required moving #define of offsetof to runtime.h)
fix bug260
Fixes#482.
Fixes#609.
R=ken2, r
CC=golang-dev
https://golang.org/cl/3563042
Specifically:
* lib/godoc:
- provide file set (FSet) argument to formatters where needed
* src/cmd:
- cgo, ebnflint, godoc, gofmt, goinstall: provide file set (fset) where needed
- godoc: remove local binary search with sort.Search (change by rsc),
extract file set for formatters
* src/pkg:
- exp/eval: remove embedded token.Position fields from nodes and replace
with named token.Pos fields; add corresponding Pos() accessor methods
- go/token: added file.Line(), changed signature of File.Position()
* test/fixedbugs/:
- bug206.go: change test to not rely on token.Pos details
* added various extra comments
* Runs all.bash
* gofmt formats all of src, misc w/o changes
* godoc runs
* performance:
- The new version of godoc consumes about the same space after indexing
has completed, but indexing is half the speed. Significant space savings
are expected from smaller ASTs, but since they are thrown away after a
file has been indexed, this is not visible anymore. The slower indexing
time is due to the much more expensive computation of line information.
However, with the new compressed position information, indexing can be
rewritten and simplified. Furthermore, computing the line info can be
done more efficiently.
New godoc, immediately after indexing completed (best of three runs):
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
44381 godoc 0.0% 0:38.00 4 19 149 145M 184K 148M 176M
2010/12/03 17:58:35 index updated (39.231s, 18505 unique words, 386387 spots)
2010/12/03 17:58:35 bytes=90858456 footprint=199182584
2010/12/03 17:58:36 bytes=47858568 footprint=167295224
Old godoc, immediately after indexing completed (best of three runs):
PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
23167 godoc 0.0% 0:22.02 4 17 132 129M 184K 132M 173M
2010/12/03 14:51:32 index updated (24.892s, 18765 unique words, 393830 spots)
2010/12/03 14:51:32 bytes=66404528 footprint=163907832
2010/12/03 14:51:32 bytes=46282224 footprint=163907832
The different numbers for unique words/spots stem from the fact the the
two workspaces are not exactly identical. The new godoc maintains a large
file set data structure during indexing which (probably) is the reason
for the larger heap (90858456 vs 66404528) before garbage collection.
R=rsc, r
CC=golang-dev
https://golang.org/cl/3050041
bug299.go:16:2: error: expected field name
bug299.go:17:2: error: expected field name
bug299.go:18:3: error: expected field name
bug299.go:25:9: error: expected receiver name or type
bug299.go:26:10: error: expected receiver name or type
bug299.go:27:9: error: expected receiver name or type
R=rsc
CC=golang-dev
https://golang.org/cl/2150044
bug284.go:33: error: invalid type conversion
bug284.go:36: error: invalid type conversion (cannot use type A2 as type A1)
bug284.go:37: error: invalid type conversion
bug284.go:38: error: invalid type conversion (cannot use type A1 as type A2)
bug284.go:56: error: invalid type conversion
bug284.go:59: error: invalid type conversion (cannot use type S2 as type S1)
bug284.go:60: error: invalid type conversion
bug284.go:61: error: invalid type conversion (cannot use type S1 as type S2)
bug284.go:71: error: invalid type conversion
bug284.go:74: error: invalid type conversion (cannot use type P2 as type P1)
bug284.go:75: error: invalid type conversion
bug284.go:76: error: invalid type conversion (cannot use type P1 as type P2)
bug284.go:96: error: invalid type conversion
bug284.go:99: error: invalid type conversion (cannot use type Q2 as type Q1)
bug284.go:101: error: invalid type conversion (cannot use type Q1 as type Q2)
bug284.go:111: error: invalid type conversion (different parameter types)
bug284.go:114: error: invalid type conversion (different parameter types)
bug284.go:115: error: invalid type conversion (different parameter types)
bug284.go:116: error: invalid type conversion (different parameter types)
bug284.go:134: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:137: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:138: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:139: error: invalid type conversion (incompatible type for method 'f' (different result types))
bug284.go:149: error: invalid type conversion
bug284.go:152: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:153: error: invalid type conversion
bug284.go:154: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:164: error: invalid type conversion
bug284.go:167: error: invalid type conversion (cannot use type L2 as type L1)
bug284.go:168: error: invalid type conversion
bug284.go:169: error: invalid type conversion (cannot use type L1 as type L2)
bug284.go:179: error: invalid type conversion
bug284.go:182: error: invalid type conversion (cannot use type C2 as type C1)
bug284.go:183: error: invalid type conversion
bug284.go:184: error: invalid type conversion (cannot use type C1 as type C2)
R=rsc
CC=golang-dev
https://golang.org/cl/2136041
bug278.go:18: error: invalid left hand side of assignment
bug278.go:19: error: array is not addressable
bug278.go:21: error: invalid left hand side of assignment
bug278.go:22: error: invalid left hand side of assignment
R=rsc
CC=golang-dev
https://golang.org/cl/2122042
The gccgo compiler is smart enough to not make something which
is not used. Use global variables to defeat this
optimization.
R=rsc
CC=golang-dev
https://golang.org/cl/2129041
Another case where gccgo and gc report similar but not
identical errors for a recursive interface.
bug251.go:11: error: invalid recursive interface
R=rsc
CC=golang-dev
https://golang.org/cl/2094041
This introduces GC_ERROR to mark an error only issued by the
gc compiler. GCCGO_ERROR already exists to mark errors only
issued by the gccgo compiler. Obviously these should be used
sparingly.
bug195.go:9: error: interface contains embedded non-interface
bug195.go:12: error: interface contains embedded non-interface
bug195.go:15: error: interface contains embedded non-interface
bug195.go:18: error: invalid recursive interface
bug195.go:22: error: invalid recursive interface
R=rsc
CC=golang-dev
https://golang.org/cl/2040043
Also, if the header is bad, exit with a non-zero status.
Other calls to Brdline in the tree, by category:
Reading symbol name from object file:
./cmd/5l/obj.c:486: name = Brdline(f, '\0');
./cmd/6l/obj.c:535: name = Brdline(f, '\0');
./cmd/8l/obj.c:564: name = Brdline(f, '\0');
./libmach/sym.c:292: cp = Brdline(bp, '\0');
Reading archive header line (fixed, short):
./cmd/gc/lex.c:287: if((a = Brdline(b, '\n')) == nil)
./cmd/gc/lex.c:303: if((p = Brdline(b, '\n')) == nil)
Reading object file header line (fixed, short):
./cmd/ld/lib.c:421: line = Brdline(f, '\n');
Reading undefined symbol list (unused code):
./cmd/ld/lib.c:773: while((l = Brdline(b, '\n')) != nil){
Implementing Brdstr:
./libbio/brdstr.c:36: p = Brdline(bp, delim);
The symbol names ones will cause a problem loudly if they
fail: they'll error out with symbol name too long. This means
that you can't define an enormous struct without giving the
type a name and then stick it in an interface, because the
type's symbol name will be too long for the object file.
Since this will be a loud failure instead of a silent one,
I'm willing to wait until it comes up in practice.
R=r
CC=golang-dev
https://golang.org/cl/1982041
remove the print statements.
This change is because of the port of gccgo to RTEMS.
These tests use the GCC DejaGNU framework. In some cases,
the tests need to be run on qemu where the status code
cannot be sent back to DejaGNU, so it prints the exit status
by putting a wrapper around the exit and abort calls.
This testcase closes the stdout, and hence prohibits DejaGNU
from knowing the status in such cases, and causes this test
to be wrongly declared as a failure.
R=rsc, iant
CC=golang-dev
https://golang.org/cl/1792042
* Code for assignment, conversions now mirrors spec.
* Changed some snprint -> smprint.
* Renamed runtime functions to separate
interface conversions from type assertions:
convT2I, assertI2T, etc.
* Correct checking of \U sequences.
Fixes#840.
Fixes#830.
Fixes#778.
R=ken2
CC=golang-dev
https://golang.org/cl/1303042
note that sortmain.go has been run through hg gofmt;
only the formatting of the day initializers changed.
i'm happy to revert that formatting if you'd prefer.
stop on error in doc/progs/run
R=r
CC=golang-dev
https://golang.org/cl/850041
bug121.go:12:3: error: name list not allowed in interface type
bug121.go:16:2: error: expected signature or type name
semi1.go:10:76: error: unexpected semicolon or newline before ‘{’
semi1.go:10:5: error: reference to undefined name ‘x’
semi1.go:10:8: error: reference to undefined name ‘y’
semi1.go:12:3: error: reference to undefined name ‘z’
semi2.go:10:79: error: unexpected semicolon or newline before ‘{’
semi2.go:10:9: error: reference to undefined name ‘x’
semi3.go:10:79: error: unexpected semicolon or newline before ‘{’
semi3.go:10:6: error: reference to undefined name ‘x’
semi3.go:10:9: error: reference to undefined name ‘y’
semi3.go:10:12: error: reference to undefined name ‘z’
semi3.go:12:3: error: reference to undefined name ‘z’
semi4.go:11:2: error: unexpected semicolon or newline before ‘{’
semi4.go:10:6: error: reference to undefined name ‘x’
semi4.go:12:3: error: reference to undefined name ‘z’
semi5.go:10:1: error: unexpected semicolon or newline before ‘{’
semi7.go:11:2: error: unexpected semicolon or newline before ‘else’
semi7.go:10:5: error: reference to undefined name ‘x’
slice.go:9:11: error: missing lower bound in slice expression
slice.go:9:9: error: reference to undefined name ‘y’
slice.go:9:12: error: reference to undefined name ‘z’
R=rsc
CC=golang-dev
https://golang.org/cl/201061
bug249.go:10:5: error: incompatible type in initialization
bug249.go:26:5: error: incompatible type in initialization
R=rsc
CC=golang-dev
https://golang.org/cl/198058
I have to admit that "cannot use type p.T as type p.T" is a
bit weak. 8g gives a similar error ("cannot use v1 (type p.T)
as type p.T in assignment").
bug3.go:37:5: error: incompatible type in initialization (incompatible type for method ‘M’ (different parameter types))
bug3.go:38:5: error: incompatible type in initialization (incompatible type for method ‘M’ (different parameter types))
bug3.go:43:5: error: incompatible type in initialization (incompatible type for method ‘M’ (different parameter types))
bug3.go:44:5: error: incompatible type in initialization (incompatible type for method ‘M’ (different parameter types))
bug3.go:49:5: error: incompatible types in assignment (cannot use type p.T as type p.T)
bug3.go:50:5: error: incompatible types in assignment (cannot use type p.T as type p.T)
bug3.go:55:5: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:56:5: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:57:6: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:58:6: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:59:5: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:60:5: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:61:6: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
bug3.go:62:6: error: incompatible types in assignment (incompatible type for method ‘M’ (different parameter types))
R=rsc
CC=golang-dev
https://golang.org/cl/199044
bug228.go:11:25: error: invalid use of ‘...’
bug228.go:13:13: error: ‘...’ only permits one name
bug228.go:15:20: error: ‘...’ must be last parameter
bug228.go:17:7: error: expected type
bug228.go:19:8: error: expected type
R=rsc
CC=golang-dev
https://golang.org/cl/196077
bonus: type switch now detects multiple uses of identical interface types.
bonus: interface types are now order-independent, following the spec.
R=ken2
CC=golang-dev
https://golang.org/cl/194053
* better error for lookup of unexported field
* do not assign "ideal string" type to typed string literal
* do not confuse methods and fields during interface check
Fixes#410.
Fixes#411.
Fixes#426.
R=ken2
https://golang.org/cl/179069
Pull the struct into a single line, since 6g reports the error
on the last line of the struct definition and gccgo reports it
on the first line.
6g:
bug215.go:12: invalid recursive type A
gccgo:
bug215.go:12:6: error: invalid recursive type ‘A’
R=rsc
https://golang.org/cl/180044
bug205.go:14:12: error: index must be integer
bug205.go:15:12: error: index must be integer
bug205.go:16:12: error: incompatible type for map index
R=rsc
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=35957
CL=35960
bug197.go:10:5: error: incompatible type in initialization
bug197.go:11:5: error: incompatible type in initialization
bug197.go:12:5: error: incompatible type in initialization
bug197.go:13:5: error: incompatible type in initialization
bug197.go:20:13: error: incompatible types in binary expression
bug197.go:21:27: error: incompatible types in binary expression
R=rsc
DELTA=6 (0 added, 0 deleted, 6 changed)
OCL=34135
CL=34177
6g's error for I4 is not quite accurate
(it calls I4 a non-interface) but also
not a crash or infinite loop.
R=iant
DELTA=15 (15 added, 0 deleted, 0 changed)
OCL=33701
CL=33709
bug165.go:13:6: error: invalid recursive type 'S'
This is a different line from the 6g error message, which is
"invalid map key type". I accomodated both compilers by
merging the line.
bug188.go:13:2: error: unexpected reference to package
I made the error message less specific, which I think is fine
here.
R=rsc
DELTA=2 (0 added, 0 deleted, 2 changed)
OCL=33398
CL=33426
bug039.go:6:7: error: redefinition of 'x'
bug039.go:5:1: note: previous definition of 'x' was here
bug049.go:6:9: error: incompatible types in binary expression
bug062.go:6:7: error: incompatible type in initialization
bug086.go:5:1: error: control reaches end of non-void function
bug103.go:8:2: error: variable has no type
bug121.go:9:2: error: expected signature or type name
bug131.go:7:7: error: incompatible type in initialization
bug165.go:10:8: error: expected complete type
bug171.go:5:1: error: control reaches end of non-void function
bug171.go:6:1: error: control reaches end of non-void function
bug172.go:7:6: error: expected integer type
bug182.go:7:2: error: if statement expects boolean expression
bug183.go:10:5: error: incompatible types in assignment
bug183.go:19:5: error: incompatible types in assignment
R=rsc
DELTA=15 (0 added, 0 deleted, 15 changed)
OCL=33168
CL=33175
let errchk exit 0 even if it has reported a BUG.
it echoed BUG and that's all that matters.
R=r
DELTA=143 (1 added, 89 deleted, 53 changed)
OCL=32533
CL=32542
bug117.go:13:12: error: reference to undefined field or method
import1.go:9:2: error: redefinition of '.main.bufio'
import1.go:8:2: note: previous definition of '.main.bufio' was here
import1.go:9:2: error: incompatible imported type 'bufio.Error'
interface9.go:25:5: error: incompatible types in assignment (method P requires a pointer)
interface9.go:30:5: error: incompatible types in assignment (method P requires a pointer)
R=rsc
DELTA=5 (0 added, 0 deleted, 5 changed)
OCL=29044
CL=29055
as a reminder, the old conversion
was that you could write
var arr [10]byte;
var slice []byte;
slice = arr;
but now you have to write
slice = &arr;
the change eliminates an implicit &, so that
the only implicit &s left are in the . operator
and in string(arr).
also, removed utf8.EncodeRuneToString
in favor of string(rune).
R=r
DELTA=83 (1 added, 23 deleted, 59 changed)
OCL=27531
CL=27534
make f(g()) work when g returns multiple
args with names different than f expects.
func swap(a, b int) (c, d int) {
return b, a
}
swap(swap(1,2))
R=ken
OCL=24474
CL=24476
* 1. all statements and declarations are terminated by semicolons
* 2. semicolons can be omitted at top level.
* 3. semicolons can be omitted before and after the closing ) or }
* on a list of statements or declarations.
/home/rsc/bin/addsemi and then diff+tweak.
R=r,gri
OCL=16620
CL=16643
type T struct {
next *T
}
and
type T *struct {
next T
}
are valid without needing forward declarations.
add "type T struct" syntax for forward struct declarations.
add "type T interface" syntax, but commented out
(need to fix semicolons first)
R=ken
DELTA=452 (259 added, 115 deleted, 78 changed)
OCL=16580
CL=16584
invalid. The receiver type is not permitted to be a pointer
type. Since 6g currently accepts it, this moves the test case
back to the bugs directory.
R=gri
DELTA=22 (11 added, 11 deleted, 0 changed)
OCL=16284
CL=16336
export.c:
- only expose explicitly exported types to importer
- fix behind your back
go.h:
- add deep() prototype (fixes 64-bit linux crash on time.go)
go.y:
- add a new syntax error case
walk.c:
- allow a,b = f() where f is func ptr (fixes bug088)
R=ken
OCL=15617
CL=15630
permits testing that the compiler emits error messages for
specific lines that match egrep regexps. The desired error
messages are expressed using comments of the form
// ERROR "regexp"
R=r
DELTA=90 (73 added, 8 deleted, 9 changed)
OCL=15513
CL=15566
if stack is in low memory and frame size is huge, test could wrap around!
fix by omitting test altogether if we know frame is big.
R=gri
OCL=14782
CL=14782
fixedbugs/bug012.go is broken again but i left it where it is, with
the golden file not reflecting the breakage so it will be noticed
R=ken,gri
OCL=14073
CL=14073