英文:
"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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论