Commit 234952b3 by Ozkan Sezer Committed by Gerald Pfeifer

re PR target/39063 (libgcc2.c:mprotect() for mingw, incompatible pointer type warning)

	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
parent f57c2f04
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> 2009-03-19 Jakub Jelinek <jakub@redhat.com>
PR target/39496 PR target/39496
......
...@@ -2068,7 +2068,7 @@ getpagesize (void) ...@@ -2068,7 +2068,7 @@ getpagesize (void)
int int
mprotect (char *addr, int len, int prot) mprotect (char *addr, int len, int prot)
{ {
int np, op; DWORD np, op;
if (prot == 7) if (prot == 7)
np = 0x40; np = 0x40;
...@@ -2082,6 +2082,8 @@ mprotect (char *addr, int len, int prot) ...@@ -2082,6 +2082,8 @@ mprotect (char *addr, int len, int prot)
np = 0x02; np = 0x02;
else if (prot == 0) else if (prot == 0)
np = 0x01; np = 0x01;
else
return -1;
if (VirtualProtect (addr, len, np, &op)) if (VirtualProtect (addr, len, np, &op))
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment