in windows replacement of mprotect() in libgcc2.c uses VirtualProtect which requires an unsigned, not a signed ptr as its last argument. the attached patch fixes a 'may be used uninitialized' warning, too. here are the warnings: ../../../gcc-svn/libgcc/../gcc/libgcc2.c: In function 'mprotect': ../../../gcc-svn/libgcc/../gcc/libgcc2.c:2079: warning: passing argument 4 of 'VirtualProtect' from incompatible pointer type /opt/buildroot/gcc-svn/winsup/mingw/include/winbase.h:1126: note: expected 'PDWORD' but argument is of type 'int *' ../../../gcc-svn/libgcc/../gcc/libgcc2.c:2064: warning: 'np' may be used uninitialized in this function
Created attachment 17222 [details] mprotect warnings fix
http://gcc.gnu.org/ml/gcc-patches/2009-03/msg00639.html
Subject: Bug 39063 Author: gerald Date: Thu Mar 19 10:40:32 2009 New Revision: 144957 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144957 Log: PR target/39063 * libgcc2.c (mprotect): Do not use signed arguments for VirtualProtect, use DWORD arguments. Also fix the 'may be used uninitialized' warning for the np variable. Modified: trunk/gcc/ChangeLog trunk/gcc/libgcc2.c
The fix may have broken cross compiling: http://gcc.gnu.org/ml/gcc/2009-03/msg00525.html
The prototype for VirtualProtect() is known but the definition of DWORD is not?? Hrmph. In any case, it should be fixed easily by changing DWORD into unsigned int which is what a DWORD is always defined as.
(In reply to comment #4) > The fix may have broken cross compiling: > > http://gcc.gnu.org/ml/gcc/2009-03/msg00525.html > PR39503 has already been closed for some fime, so this one should be closed, too.