From 234952b3832aa8dd302680b1b51a0645b3c2f90f Mon Sep 17 00:00:00 2001 From: Ozkan Sezer Date: Thu, 19 Mar 2009 10:40:32 +0000 Subject: [PATCH] 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 --- gcc/ChangeLog | 7 +++++++ gcc/libgcc2.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b7c4b24968f..d5ebcedfad7c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2009-03-19 Ozkan Sezer + + 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 PR target/39496 diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c index 0966ac216c23..369c29f6abff 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; -- 2.47.2