This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Minor Ada front end fixes for MinGW
- From: "Aaron W. LaFramboise" <aaronavay62 at aaronwl dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 12 Sep 2004 19:30:17 -0500
- Subject: Minor Ada front end fixes for MinGW
The following three fixes eliminate some warnings in the Ada front end
on MinGW:
1) value is a char, but Win32 BYTE is unsigned.
2) The args_0 temporary variable is const but shouldn't be because args
is not.
3) MAXPATHLEN is defined by mingwrt.
2004-09-12 Aaron W. LaFramboise <aaronavay62@aaronwl.com>
* adaint.c (__gnat_get_libraries_from_registry): Cast value
to LPBYTE.
(__gnat_portable_spawn): Remove const.
* mingw32.h (MAXPATHLEN): Check for previous definition.
Index: gcc/gcc/ada/adaint.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ada/adaint.c,v
retrieving revision 1.37
diff -c -3 -p -r1.37 adaint.c
*** gcc/gcc/ada/adaint.c 16 Aug 2004 09:00:19 -0000 1.37
--- gcc/gcc/ada/adaint.c 11 Sep 2004 23:47:39 -0000
*************** __gnat_get_libraries_from_registry (void
*** 1348,1354 ****
{
value_size = name_size = 256;
res = RegEnumValue (reg_key, index, name, &name_size, 0,
! &type, value, &value_size);
if (res == ERROR_SUCCESS && type == REG_SZ)
{
--- 1348,1354 ----
{
value_size = name_size = 256;
res = RegEnumValue (reg_key, index, name, &name_size, 0,
! &type, (LPBYTE)value, &value_size);
if (res == ERROR_SUCCESS && type == REG_SZ)
{
*************** __gnat_portable_spawn (char *args[])
*** 1551,1557 ****
#if defined (MSDOS) || defined (_WIN32)
/* args[0] must be quotes as it could contain a full pathname with
spaces */
! const char *args_0 = args[0];
args[0] = (char *)xmalloc (strlen (args_0) + 3);
strcpy (args[0], "\"");
strcat (args[0], args_0);
--- 1551,1557 ----
#if defined (MSDOS) || defined (_WIN32)
/* args[0] must be quotes as it could contain a full pathname with
spaces */
! char *args_0 = args[0];
args[0] = (char *)xmalloc (strlen (args_0) + 3);
strcpy (args[0], "\"");
strcat (args[0], args_0);
Index: gcc/gcc/ada/mingw32.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/ada/mingw32.h,v
retrieving revision 1.1
diff -c -3 -p -r1.1 mingw32.h
*** gcc/gcc/ada/mingw32.h 22 Oct 2003 07:59:32 -0000 1.1
--- gcc/gcc/ada/mingw32.h 11 Sep 2004 23:47:41 -0000
***************
*** 49,54 ****
--- 49,56 ----
#define OLD_MINGW (!(STD_MINGW))
+ #ifndef MAXPATHLEN
#define MAXPATHLEN MAX_PATH
+ #endif
#endif /* _MINGW32_H */