gccgo: accepts invalid UTF-8
dvyukov opened this issue · 4 comments
dvyukov commented
gcc compiles the following program, while gc and go/types reject it:
package G
//line \FF:8
(that \FF needs to be converted to actual FF byte)
gc and go/types say:
go.go:2:8: illegal UTF-8 encoding
go.go:2: illegal UTF-8 sequence ff 3a
Compilers should agree on validity of this program.
gcc version 6.0.0 2015070 (experimental) (GCC)
dvyukov commented
paranoiacblack commented
Is this still a problem? gc and go/types also accept the above program so it seems all compilers agree on the validity of the program.
dvyukov commented
replace \ff with actual 0xff byte
gopherbot commented
CL https://golang.org/cl/13905 mentions this issue.