]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/39063 (libgcc2.c:mprotect() for mingw, incompatible pointer type warning)
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 19 Mar 2009 10:40:32 +0000 (10:40 +0000)
committerGerald Pfeifer <gerald@gcc.gnu.org>
Thu, 19 Mar 2009 10:40:32 +0000 (10:40 +0000)
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.

From-SVN: r144957

gcc/ChangeLog
gcc/libgcc2.c

index 9b7c4b24968f7148fd9e6635d3b8197919a1497d..d5ebcedfad7cbdb2dc1d939fb208e12bf71933b6 100644 (file)
@@ -1,3 +1,10 @@
+2009-03-19  Ozkan Sezer <sezeroz@gmail.com>
+
+       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.
+
 2009-03-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/39496
index 0966ac216c230366a2286c254031010134689bba..369c29f6abff1a201c390d2a6effbe272b7c6db9 100644 (file)
@@ -2068,7 +2068,7 @@ getpagesize (void)
 int
 mprotect (char *addr, int len, int prot)
 {
-  int np, op;
+  DWORD np, op;
 
   if (prot == 7)
     np = 0x40;
@@ -2082,6 +2082,8 @@ mprotect (char *addr, int len, int prot)
     np = 0x02;
   else if (prot == 0)
     np = 0x01;
+  else
+    return -1;
 
   if (VirtualProtect (addr, len, np, &op))
     return 0;