On Sat, 4 Apr 2020, Liu Hao wrote:

在 2020/4/4 16:28, Martin Storsjö 写道:

Did you actually test this at all, in any way, whatsoever?

Because the newly added function declarations use the types
MEM_EXTENDED_PARAMETER and PCFG_CALL_TARGET_INFO, that aren't declared
anywhere in mingw-w64 headers.



Hmm.. how could this compile with the following command:

```
gcc -xc -D_WIN32_WINNT=0xFFFF -include windows.h -std=c89 -Wall -Wextra
memoryapi.h
```

This is also what I use to verify each header that it actually compiles
before pushing those patches. I think I will have to run complete builds
hereafter.

In this case - I hadn't expected you to verify it before pushing, I had expected the patch author to try to use it - but if you do such checks before pushing, it's really commendable!

In this case, it turns out that it didn't pick up the issue, because windows.h in itself also includes memoryapi.h, and it will include windows.h from your compiler's default sysroot, and that one will transitively include memoryapi.h from there as well. After finishing including windows.h, it will try to include your new version of memoryapi.h and skip it due to the header guards.

By adding -I. or similar you would notice the issue. (Unfortunately, our headers are fairly noisy if used this way - the compilers normally silence a number of warnings stemming from "system headers" - but in this case, all the headers are picked from a directory specified by -I, which isn't treated as the compiler default sysroot, and thus all warnings are shown.)

// Martin

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to