在编译Go 1.4.2时出现了"dereferencing type-punned pointer"错误。

huangapple go评论104阅读模式
英文:

"dereferencing type-punned pointer" error when compiling Go 1.4.2

问题

我正在Windows上使用MinGW从源代码编译Go语言。在运行make.bat时,我遇到了以下错误:

# Building C bootstrap tool.
cmd/dist
cmd/dist/windows.c: 在函数 `errstr` 中:
cmd/dist/windows.c:119: 警告:解引用类型转换的指针将违反严格别名规则

我对在Windows上编译不是很有经验,而且似乎这个问题并不常见,因为谷歌没有返回与Go语言相关的特定结果。

编辑1:诚然,这只是一个警告,而不是错误。然而,代码中的检查 if errorlevel 1 goto fail 似乎将这个输出视为错误,并停止了脚本的进程。

英文:

I'm compiling Go from source on Windows with MinGW. When running make.bat, I get the following error:

# Building C bootstrap tool.
cmd/dist
cmd/dist/windows.c: In function `errstr`:
cmd/dist/windows.c:119: warning: deferencing type-punned pointer will break strict-aliasing rules

I'm not very experienced with compiling on Windows, and it appears like this issue isn't very common, as Google doesn't return anything for it specific to Go.

Edit 1: Admittedly this is a warning, not an error. However a check in the code if errorlevel 1 goto fail appears to consider this output an error, and stops the progress of the script.

答案1

得分: 1

Go for Windows使用TDM-GCC,这是一个基于GNU工具链的用于32位和64位Windows的编译器套件。

例如,

C:\>gcc --version
gcc (tdm64-1) 4.9.2
英文:

Go for Windows uses TDM-GCC, a compiler suite for 32- and 64-bit Windows based on the GNU toolchain.

For example,

C:\>gcc --version
gcc (tdm64-1) 4.9.2

huangapple
  • 本文由 发表于 2015年3月12日 17:33:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/29006078.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定