On 25 October 2017 at 02:50, Liu Hao wrote: > On 2017/10/24 23:55, Jonathan Wakely wrote: >> >> On 23 October 2017 at 15:55, David Gressett wrote: >>> >>> gcc needs some substantial patching to to build on Windows. >>> The details depend on whether you are building a 64-bit or a 32-bit gcc. >>> >>> There are two projects on Sourceforge which deal with gcc on Windows: >>> >>> MinGW (32-bit) and MinGW-w64 (64-bit) >>> >>> The mailing lists for those projects are the best places to go to for >>> information about >>> building on Windows for a Windows target. >> >> >> Did you ever get to the bottom of the problem in >> https://gcc.gnu.org/ml/gcc-help/2017-04/msg00133.html ? >> >> I see _aligned_malloc in MinGW's <malloc.h> so if the configure script >> found it then I don't understand how it can be missing later. >> >> If that code still doesn't build we need a bug report. >> > > The attached program would not compile if the first line were uncommented, > which looks like a bug to me. > > ``` > // #include <intrin.h> > #include <malloc.h> > #include <stdio.h> > > int main(void){ > void *ptr; > > ptr = _aligned_malloc(1000, 32); > printf("ptr = %p\n", ptr); > _aligned_free(ptr); > } > ``` > > ``` > E:\Desktop>gcc -Wall -Wextra -pedantic -pedantic-errors -std=c99 test.c Is this because -std=c99 sets __STRICT_ANSI__? The C++ runtime is not built with -std=c99, of course. I don't really care whether _aligned_malloc works in arbitrary C programs, what I care about is whether it works in libsupc++/new_opa.cc when _GLIBCXX_HAVE__ALIGNED_MALLOC is defined. I assume new_opa.cc does build for MinGW-w64, but does it build for MinGW? That still seems to be stuck on GCC 4.x