Skip to content

gc compiler error: confusing error messages for unused constant expression #2276

@ianlancetaylor

Description

@ianlancetaylor
This is a variant of issue #1722 aka bug337.go

cat > foo.go << _EOF_
package main

import "unsafe"

func main() {
    unsafe.Alignof(0)
}
_EOF_
6g foo.go
foo.go:6: 4 not used

The error message should say Alignof(0), or "function call", or many other
things, but definitely not "4".

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions