This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] libgcc2.c:mprotect() for mingw, incompatible pointer type warning


in windows replacement of mprotect() in libgcc2.c uses VirtualProtect
which requires an unsigned, not a signed ptr as its last argument.
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

the attached trivial patch fixes it. it also fixes a 'may be used uninitialized'
warning, too.

--
Ozkan

PS: this was previously entered as an entry in the gcc bugzilla (39063).

Attachment: libgcc2-mprotect.patch
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]