aboutsummaryrefslogtreecommitdiff
path: root/gcc/libgcc2.c
diff options
context:
space:
mode:
authorOzkan Sezer <sezeroz@gmail.com>2009-03-19 10:40:32 +0000
committerGerald Pfeifer <gerald@gcc.gnu.org>2009-03-19 10:40:32 +0000
commit234952b3832aa8dd302680b1b51a0645b3c2f90f (patch)
tree48fe00893a34d67e409a9aa79c469571653f847d /gcc/libgcc2.c
parentf57c2f04ae121b2503b0b6bb93465dfe365b4d12 (diff)
downloadgcc-234952b3832aa8dd302680b1b51a0645b3c2f90f.zip
gcc-234952b3832aa8dd302680b1b51a0645b3c2f90f.tar.gz
gcc-234952b3832aa8dd302680b1b51a0645b3c2f90f.tar.bz2
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
Diffstat (limited to 'gcc/libgcc2.c')
-rw-r--r--gcc/libgcc2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 0966ac2..369c29f 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -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;