Bug 52123 - [4.7/4.8 Regression] gcc bootstrap with ada fails on mingw target
Summary: [4.7/4.8 Regression] gcc bootstrap with ada fails on mingw target
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: ada (show other bugs)
Version: 4.7.0
: P4 normal
Target Milestone: 4.7.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 55704 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-02-04 13:40 UTC by Daniel Starke
Modified: 2013-03-08 08:09 UTC (History)
3 users (show)

See Also:
Host: mingw
Target: mingw
Build: mingw
Known to work:
Known to fail:
Last reconfirmed: 2012-12-20 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Starke 2012-02-04 13:40:45 UTC
Bootstrapping gcc 4.7 revision 183875 fails at /gcc/ada/initialize.c when configuring with:
--enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-sjlj-exceptions --disable-nls --disable-shared --enable-static --enable-libgomp --enable-lto --with-dwarf2 --disable-win32-registry --enable-version-specific-runtime-libs --build=mingw32 --enable-abi=32 --enable-bootstrap --enable-checking=release


Used compiler for bootstrap:
Using built-in specs.
COLLECT_GCC=D:\Programme\msys\gcc\bin\gcc.exe
COLLECT_LTO_WRAPPER=d:/programme/msys/gcc/bin/../libexec/gcc/mingw32/4.6.2/lto-wrapper.exe
Target: mingw32
Configured with: ../gcc-4.6.2/configure --enable-languages=c,ada,c++,fortran,objc,obj-c++ --disable-sjlj-exceptions --disable-nls --disable-shared --enable-static --enable-libgcj --enable-libgomp --enable-lto --with-dwarf2 --disable-win32-registry --enable-version-specific-runtime-libs --build=mingw32 --enable-abi=32 --enable-checking=release --prefix=/mingw
Thread model: win32
gcc version 4.6.2 (GCC)


Error message:
/usr/new-gcc/bin/./prev-gcc/g++ -B/usr/new-gcc/bin/./prev-gcc/ -B/mingw/mingw32/bin/ -nostdinc++ -B/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/src/.libs -B/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/libsupc++/.libs -I/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/include/mingw32 -I/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/include -I/usr/new-gcc/gcc-4.7.0-183875/libstdc++-v3/libsupc++ -L/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/src/.libs -L/usr/new-gcc/bin/prev-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror   -DHAVE_CONFIG_H -I. -Iada -I../../gcc-4.7.0-183875/gcc -I../../gcc-4.7.0-183875/gcc/ada -I../../gcc-4.7.0-183875/gcc/../include -I../../gcc-4.7.0-183875/gcc/../libcpp/include -I/usr/new-gcc/bin/./gmp -I/usr/new-gcc/gcc-4.7.0-183875/gmp -I/usr/new-gcc/bin/./mpfr -I/usr/new-gcc/gcc-4.7.0-183875/mpfr -I/usr/new-gcc/gcc-4.7.0-183875/mpc/src  -I../../gcc-4.7.0-183875/gcc/../libdecnumber -I../../gcc-4.7.0-183875/gcc/../libdecnumber/bid -I../libdecnumber   -I/mingw/include ../../gcc-4.7.0-183875/gcc/ada/seh_init.c -o ada/seh_init.o
../../gcc-4.7.0-183875/gcc/ada/initialize.c: In function 'void append_arg(int*, LPWSTR, LPWSTR, char***, int*, int)':
../../gcc-4.7.0-183875/gcc/ada/initialize.c:91:56: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../gcc-4.7.0-183875/gcc/ada/initialize.c:98:65: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../gcc-4.7.0-183875/gcc/ada/initialize.c: In function 'void __gnat_initialize(void*)':
../../gcc-4.7.0-183875/gcc/ada/initialize.c:206:44: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
make[3]: *** [ada/initialize.o] Error 1
make[3]: *** Waiting for unfinished jobs....
../../gcc-4.7.0-183875/gcc/ada/seh_init.c: In function 'EXCEPTION_DISPOSITION __gnat_SEH_error_handler(_EXCEPTION_RECORD*, void*, _CONTEXT*, void*)':
../../gcc-4.7.0-183875/gcc/ada/seh_init.c:93:62: error: invalid conversion from 'void*' to 'FARPROC {aka int (__attribute__((__stdcall__)) *)()}' [-fpermissive]
In file included from d:\programme\msys\new-gcc\bin\prev-gcc\../lib/gcc/mingw32/4.7.0/../../../../mingw32/include/windows.h:50:0,
                 from ../../gcc-4.7.0-183875/gcc/ada/seh_init.c:68:
d:\programme\msys\new-gcc\bin\prev-gcc\../lib/gcc/mingw32/4.7.0/../../../../mingw32/include/winbase.h:1865:24: error:   initializing argument 1 of 'BOOL IsBadCodePtr(FARPROC)' [-fpermissive]
../../gcc-4.7.0-183875/gcc/ada/seh_init.c:196:10: error: invalid conversion from 'int' to 'EXCEPTION_DISPOSITION' [-fpermissive]
Comment 1 Richard Biener 2012-06-14 08:48:19 UTC
GCC 4.7.1 is being released, adjusting target milestone.
Comment 2 Jakub Jelinek 2012-09-20 10:21:16 UTC
GCC 4.7.2 has been released.
Comment 3 Eric Botcazou 2012-12-15 11:07:07 UTC
*** Bug 55704 has been marked as a duplicate of this bug. ***
Comment 4 Rainer Emrich 2012-12-19 10:40:30 UTC
Ok, long standing issue caused by the transition to g++ as bootstrap compiler.

Here's the status for gcc-4.7.3 rev. 194494 on x86_64-w64-mingw32:

/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/g++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/ -B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-4.7.3/x86_64-w64-mingw32/bin/ -nostdinc++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include -I/SCRATCH/tmp.wOrMZOydvQ/src/gcc-4.7.3/libstdc++-v3/libsupc++ -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  -Wno-error -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.7.3/gcc -I../../../src/gcc-4.7.3/gcc/ada -I../../../src/gcc-4.7.3/gcc/../include -I./../intl -I../../../src/gcc-4.7.3/gcc/../libcpp/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I../../../src/gcc-4.7.3/gcc/../libdecnumber -I../../../src/gcc-4.7.3/gcc/../libdecnumber/bid -I../libdecnumber -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I/SCRATCH/tmp.wOrMZOydvQ/install/include  ../../../src/gcc-4.7.3/gcc/ada/adaint.c -o ada/adaint.o
../../../src/gcc-4.7.3/gcc/ada/adaint.c: In function 'int __gnat_check_OWNER_ACL(TCHAR*, DWORD, GENERIC_MAPPING)':
../../../src/gcc-4.7.3/gcc/ada/adaint.c:1986:53: error: invalid conversion from 'PSECURITY_DESCRIPTOR {aka void*}' to 'SECURITY_DESCRIPTOR* {aka _SECURITY_DESCRIPTOR*}' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c: In function 'void __gnat_set_OWNER_ACL(TCHAR*, DWORD, DWORD)':
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2062:66: error: invalid conversion from 'DWORD {aka long unsigned int}' to 'ACCESS_MODE {aka _ACCESS_MODE}' [-fpermissive]
In file included from ../../../src/gcc-4.7.3/gcc/ada/adaint.c:231:0:
D:/x86_64-w64-trunk/mingw/include/aclapi.h:67:25: error:   initializing argument 4 of 'void BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W, LPWSTR, DWORD, ACCESS_MODE, DWORD)' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c: In function 'int __gnat_portable_spawn(char**)':
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2387:61: error: invalid conversion from 'const char* const*' to 'char* const*' [-fpermissive]
In file included from D:/x86_64-w64-trunk/mingw/include/unistd.h:11:0,
                 from ../../../src/gcc-4.7.3/gcc/system.h:253,
                 from ../../../src/gcc-4.7.3/gcc/ada/adaint.c:107:
D:/x86_64-w64-trunk/mingw/include/process.h:177:20: error:   initializing argument 3 of 'intptr_t spawnvp(int, const char*, char* const*)' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c: In function 'void add_handle(HANDLE, int)':
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2547:67: error: invalid conversion from 'void*' to 'void**' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2549:60: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c: In function 'char* __gnat_locate_exec_on_path(char*)':
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2938:16: error: invalid conversion from 'void*' to 'TCHAR* {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/adaint.c:2948:15: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
make[3]: *** [ada/adaint.o] Error 1
/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/g++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/ -B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-4.7.3/x86_64-w64-mingw32/bin/ -nostdinc++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include -I/SCRATCH/tmp.wOrMZOydvQ/src/gcc-4.7.3/libstdc++-v3/libsupc++ -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.7.3/gcc -I../../../src/gcc-4.7.3/gcc/ada -I../../../src/gcc-4.7.3/gcc/../include -I./../intl -I../../../src/gcc-4.7.3/gcc/../libcpp/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I../../../src/gcc-4.7.3/gcc/../libdecnumber -I../../../src/gcc-4.7.3/gcc/../libdecnumber/bid -I../libdecnumber -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I/SCRATCH/tmp.wOrMZOydvQ/install/include  ../../../src/gcc-4.7.3/gcc/ada/initialize.c -o ada/initialize.o
../../../src/gcc-4.7.3/gcc/ada/initialize.c: In function 'void append_arg(int*, LPWSTR, LPWSTR, char***, int*, int)':
../../../src/gcc-4.7.3/gcc/ada/initialize.c:91:56: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/initialize.c:98:65: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/initialize.c: In function 'void __gnat_initialize(void*)':
../../../src/gcc-4.7.3/gcc/ada/initialize.c:206:44: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
make[3]: *** [ada/initialize.o] Error 1
/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/g++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/./prev-gcc/ -B/opt/devel/gnu/gcc/MINGW_NT/x86_64-w64-mingw32/mingw-w64-runtime-trunk-svn/gcc-4.7.3/x86_64-w64-mingw32/bin/ -nostdinc++ -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -B/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include/x86_64-w64-mingw32 -I/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/include -I/SCRATCH/tmp.wOrMZOydvQ/src/gcc-4.7.3/libstdc++-v3/libsupc++ -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/src/.libs -L/SCRATCH/tmp.wOrMZOydvQ/gcc-4.7.3/gcc-4.7.3/prev-x86_64-w64-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC   -fno-exceptions -fno-rtti -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.7.3/gcc -I../../../src/gcc-4.7.3/gcc/ada -I../../../src/gcc-4.7.3/gcc/../include -I./../intl -I../../../src/gcc-4.7.3/gcc/../libcpp/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I../../../src/gcc-4.7.3/gcc/../libdecnumber -I../../../src/gcc-4.7.3/gcc/../libdecnumber/bid -I../libdecnumber -I/SCRATCH/tmp.wOrMZOydvQ/install/include  -I/SCRATCH/tmp.wOrMZOydvQ/install/include  ../../../src/gcc-4.7.3/gcc/ada/seh_init.c -o ada/seh_init.o
../../../src/gcc-4.7.3/gcc/ada/seh_init.c: In function 'int __gnat_SEH_error_handler(_EXCEPTION_RECORD*, void*, _CONTEXT*, void*)':
../../../src/gcc-4.7.3/gcc/ada/seh_init.c:93:62: error: invalid conversion from 'void*' to 'FARPROC {aka long long int (*)()}' [-fpermissive]
In file included from D:/x86_64-w64-trunk/mingw/include/windows.h:70:0,
                 from ../../../src/gcc-4.7.3/gcc/ada/seh_init.c:68:
D:/x86_64-w64-trunk/mingw/include/winbase.h:2406:29: error:   initializing argument 1 of 'WINBOOL IsBadCodePtr(FARPROC)' [-fpermissive]
../../../src/gcc-4.7.3/gcc/ada/seh_init.c: At global scope:
../../../src/gcc-4.7.3/gcc/ada/seh_init.c:77:1: warning: unused parameter 'EstablisherFrame' [-Wunused-parameter]
make[3]: *** [ada/seh_init.o] Error 1


Proposed patch, tested on x86_64-w64-mingw32:

Index: gcc/ada/adaint.c
===================================================================
--- gcc/ada/adaint.c	(Revision 194496)
+++ gcc/ada/adaint.c	(Arbeitskopie)
@@ -1982,7 +1982,7 @@ __gnat_check_OWNER_ACL
      GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
      NULL, 0, &nLength);
 
-  if ((pSD = (PSECURITY_DESCRIPTOR) HeapAlloc
+  if ((pSD = (SECURITY_DESCRIPTOR *) HeapAlloc
        (GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL)
     return 0;
 
@@ -2059,7 +2059,7 @@ __gnat_set_OWNER_ACL
     return;
 
   BuildExplicitAccessWithName
-    (&ea, username, AccessPermissions, AccessMode, NO_INHERITANCE);
+    (&ea, username, AccessPermissions, (ACCESS_MODE) AccessMode, NO_INHERITANCE);
 
   if (AccessMode == SET_ACCESS)
     {
@@ -2384,7 +2384,7 @@ __gnat_portable_spawn (char *args[])
   strcat (args[0], args_0);
   strcat (args[0], "\"");
 
-  status = spawnvp (P_WAIT, args_0, (const char* const*)args);
+  status = spawnvp (P_WAIT, args_0, (char* const*)args);
 
   /* restore previous value */
   free (args[0]);
@@ -2544,9 +2544,9 @@ add_handle (HANDLE h, int pid)
     {
       plist_max_length += 1000;
       HANDLES_LIST =
-        xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
+        (void **) xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
       PID_LIST =
-        xrealloc (PID_LIST, sizeof (int) * plist_max_length);
+        (int *) xrealloc (PID_LIST, sizeof (int) * plist_max_length);
     }
 
   HANDLES_LIST[plist_length] = h;
@@ -2935,7 +2935,7 @@ __gnat_locate_exec_on_path (char *exec_n
 
   #define EXPAND_BUFFER_SIZE 32767
 
-  wapath_val = alloca (EXPAND_BUFFER_SIZE);
+  wapath_val = (TCHAR *) alloca (EXPAND_BUFFER_SIZE);
 
   wapath_val [0] = '.';
   wapath_val [1] = ';';
@@ -2945,7 +2945,7 @@ __gnat_locate_exec_on_path (char *exec_n
 
   if (!res) wapath_val [0] = _T('\0');
 
-  apath_val = alloca (EXPAND_BUFFER_SIZE);
+  apath_val = (char *) alloca (EXPAND_BUFFER_SIZE);
 
   WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE);
   return __gnat_locate_exec (exec_name, apath_val);
Index: gcc/ada/initialize.c
===================================================================
--- gcc/ada/initialize.c	(Revision 194496)
+++ gcc/ada/initialize.c	(Arbeitskopie)
@@ -88,14 +88,14 @@ append_arg (int *index, LPWSTR dir, LPWS
     {
       /* no dir prefix */
       dirlen = 0;
-      fullvalue = xmalloc ((vallen + 1) * sizeof(TCHAR));
+      fullvalue = (LPWSTR) xmalloc ((vallen + 1) * sizeof(TCHAR));
     }
   else
     {
       /* Add dir first */
       dirlen = _tcslen (dir);
 
-      fullvalue = xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
+      fullvalue = (LPWSTR) xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
       _tcscpy (fullvalue, dir);
     }
 
@@ -203,7 +203,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UN
 		     if (ldir != NULL)
 		       {
 			 int n = ldir - wargv[k] + 1;
-			 dir = xmalloc ((n + 1) * sizeof (TCHAR));
+			 dir = (LPWSTR) xmalloc ((n + 1) * sizeof (TCHAR));
 			 _tcsncpy (dir, wargv[k], n);
 			 dir[n] = _T('\0');
 		       }
Index: gcc/ada/seh_init.c
===================================================================
--- gcc/ada/seh_init.c	(Revision 194496)
+++ gcc/ada/seh_init.c	(Arbeitskopie)
@@ -90,7 +90,7 @@ __gnat_SEH_error_handler (struct _EXCEPT
       */
       if ((ExceptionRecord->ExceptionInformation[1] & 3) != 0
 	  || IsBadCodePtr
-	  ((void *)(ExceptionRecord->ExceptionInformation[1] + 4096)))
+	  ((FARPROC)(ExceptionRecord->ExceptionInformation[1] + 4096)))
 	{
 	  exception = &program_error;
 	  msg = "EXCEPTION_ACCESS_VIOLATION";
Index: gcc/graphite-dependences.c
===================================================================
--- gcc/graphite-dependences.c	(Revision 194496)
+++ gcc/graphite-dependences.c	(Arbeitskopie)
@@ -56,7 +56,7 @@ hash_poly_ddr_p (const void *pddr)
 {
   const struct poly_ddr *p = (const struct poly_ddr *) pddr;
 
-  return (hashval_t) ((long) PDDR_SOURCE (p) + (long) PDDR_SINK (p));
+  return (hashval_t) ((intptr_t) PDDR_SOURCE (p) + (intptr_t) PDDR_SINK (p));
 }
 
 /* Returns true when PDDR has no dependence.  */
Comment 5 Rainer Emrich 2012-12-19 10:50:15 UTC
Last Chunk is not part of the patch, it's for a different issue, see PR55707.
Comment 6 Rainer Emrich 2012-12-19 10:55:55 UTC
Here's the status for gcc-4.8.0 rev. 194494 on x86_64-w64-mingw32:

g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings  -Wno-error -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.8.0/gcc -I../../../src/gcc-4.8.0/gcc/ada -I../../../src/gcc-4.8.0/gcc/../include -I./../intl -I../../../src/gcc-4.8.0/gcc/../libcpp/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  -I../../../src/gcc-4.8.0/gcc/../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libbacktrace -DCLOOG_INT_GMP -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  ../../../src/gcc-4.8.0/gcc/ada/adaint.c -o ada/adaint.o
../../../src/gcc-4.8.0/gcc/ada/adaint.c: In function 'int __gnat_check_OWNER_ACL(TCHAR*, DWORD, GENERIC_MAPPING)':
../../../src/gcc-4.8.0/gcc/ada/adaint.c:1986:53: error: invalid conversion from 'PSECURITY_DESCRIPTOR {aka void*}' to 'SECURITY_DESCRIPTOR* {aka _SECURITY_DESCRIPTOR*}' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c: In function 'void __gnat_set_OWNER_ACL(TCHAR*, DWORD, DWORD)':
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2062:66: error: invalid conversion from 'DWORD {aka long unsigned int}' to 'ACCESS_MODE {aka _ACCESS_MODE}' [-fpermissive]
In file included from ../../../src/gcc-4.8.0/gcc/ada/adaint.c:230:0:
D:/x86_64-w64-trunk/mingw/include/aclapi.h:67:25: error:   initializing argument 4 of 'void BuildExplicitAccessWithNameW(PEXPLICIT_ACCESS_W, LPWSTR, DWORD, ACCESS_MODE, DWORD)' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c: In function 'int __gnat_portable_spawn(char**)':
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2387:61: error: invalid conversion from 'const char* const*' to 'char* const*' [-fpermissive]
In file included from D:/x86_64-w64-trunk/mingw/include/unistd.h:11:0,
                 from ../../../src/gcc-4.8.0/gcc/system.h:256,
                 from ../../../src/gcc-4.8.0/gcc/ada/adaint.c:106:
D:/x86_64-w64-trunk/mingw/include/process.h:177:20: error:   initializing argument 3 of 'intptr_t spawnvp(int, const char*, char* const*)' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c: In function 'void add_handle(HANDLE, int)':
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2543:67: error: invalid conversion from 'void*' to 'void**' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2545:60: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c: In function 'char* __gnat_locate_exec_on_path(char*)':
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2934:16: error: invalid conversion from 'void*' to 'TCHAR* {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/adaint.c:2944:15: error: invalid conversion from 'void*' to 'char*' [-fpermissive]
make[3]: *** [ada/adaint.o] Error 1
g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.8.0/gcc -I../../../src/gcc-4.8.0/gcc/ada -I../../../src/gcc-4.8.0/gcc/../include -I./../intl -I../../../src/gcc-4.8.0/gcc/../libcpp/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  -I../../../src/gcc-4.8.0/gcc/../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libbacktrace -DCLOOG_INT_GMP -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  ../../../src/gcc-4.8.0/gcc/ada/initialize.c -o ada/initialize.o
../../../src/gcc-4.8.0/gcc/ada/initialize.c: In function 'void append_arg(int*, LPWSTR, LPWSTR, char***, int*, int)':
../../../src/gcc-4.8.0/gcc/ada/initialize.c:91:56: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/initialize.c:98:65: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
../../../src/gcc-4.8.0/gcc/ada/initialize.c: In function 'void __gnat_initialize(void*)':
../../../src/gcc-4.8.0/gcc/ada/initialize.c:206:44: error: invalid conversion from 'void*' to 'LPWSTR {aka wchar_t*}' [-fpermissive]
make[3]: *** [ada/initialize.o] Error 1
g++ -c   -g -DIN_GCC   -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual  -Wmissing-format-attribute -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -I. -Iada -I../../../src/gcc-4.8.0/gcc -I../../../src/gcc-4.8.0/gcc/ada -I../../../src/gcc-4.8.0/gcc/../include -I./../intl -I../../../src/gcc-4.8.0/gcc/../libcpp/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  -I../../../src/gcc-4.8.0/gcc/../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../../src/gcc-4.8.0/gcc/../libbacktrace -DCLOOG_INT_GMP -I/SCRATCH/tmp.sTvWvLQnyU/install/include -I/SCRATCH/tmp.sTvWvLQnyU/install/include  ../../../src/gcc-4.8.0/gcc/ada/seh_init.c -o ada/seh_init.o
../../../src/gcc-4.8.0/gcc/ada/seh_init.c: In function 'Exception_Data* __gnat_map_SEH(EXCEPTION_RECORD*, const char**)':
../../../src/gcc-4.8.0/gcc/ada/seh_init.c:94:62: error: invalid conversion from 'void*' to 'FARPROC {aka long long int (*)()}' [-fpermissive]
In file included from D:/x86_64-w64-trunk/mingw/include/windows.h:70:0,
                 from ../../../src/gcc-4.8.0/gcc/ada/seh_init.c:68:
D:/x86_64-w64-trunk/mingw/include/winbase.h:2406:29: error:   initializing argument 1 of 'WINBOOL IsBadCodePtr(FARPROC)' [-fpermissive]
make[3]: *** [ada/seh_init.o] Error 1


Proposed patch, tested on x86_64-w64-mingw32:

Index: ada/adaint.c
===================================================================
--- ada/adaint.c	(Revision 194496)
+++ ada/adaint.c	(Arbeitskopie)
@@ -1982,7 +1982,7 @@ __gnat_check_OWNER_ACL
      GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
      NULL, 0, &nLength);
 
-  if ((pSD = (PSECURITY_DESCRIPTOR) HeapAlloc
+  if ((pSD = (SECURITY_DESCRIPTOR *) HeapAlloc
        (GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL)
     return 0;
 
@@ -2059,7 +2059,7 @@ __gnat_set_OWNER_ACL
     return;
 
   BuildExplicitAccessWithName
-    (&ea, username, AccessPermissions, AccessMode, NO_INHERITANCE);
+    (&ea, username, AccessPermissions, (ACCESS_MODE) AccessMode, NO_INHERITANCE);
 
   if (AccessMode == SET_ACCESS)
     {
@@ -2384,7 +2384,7 @@ __gnat_portable_spawn (char *args[])
   strcat (args[0], args_0);
   strcat (args[0], "\"");
 
-  status = spawnvp (P_WAIT, args_0, (const char* const*)args);
+  status = spawnvp (P_WAIT, args_0, (char* const*)args);
 
   /* restore previous value */
   free (args[0]);
@@ -2540,9 +2540,9 @@ add_handle (HANDLE h, int pid)
     {
       plist_max_length += 1000;
       HANDLES_LIST =
-        xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
+        (void **) xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
       PID_LIST =
-        xrealloc (PID_LIST, sizeof (int) * plist_max_length);
+        (int *) xrealloc (PID_LIST, sizeof (int) * plist_max_length);
     }
 
   HANDLES_LIST[plist_length] = h;
@@ -2931,7 +2931,7 @@ __gnat_locate_exec_on_path (char *exec_n
 
   #define EXPAND_BUFFER_SIZE 32767
 
-  wapath_val = alloca (EXPAND_BUFFER_SIZE);
+  wapath_val = (TCHAR *) alloca (EXPAND_BUFFER_SIZE);
 
   wapath_val [0] = '.';
   wapath_val [1] = ';';
@@ -2941,7 +2941,7 @@ __gnat_locate_exec_on_path (char *exec_n
 
   if (!res) wapath_val [0] = _T('\0');
 
-  apath_val = alloca (EXPAND_BUFFER_SIZE);
+  apath_val = (char *) alloca (EXPAND_BUFFER_SIZE);
 
   WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE);
   return __gnat_locate_exec (exec_name, apath_val);
Index: ada/initialize.c
===================================================================
--- ada/initialize.c	(Revision 194496)
+++ ada/initialize.c	(Arbeitskopie)
@@ -88,14 +88,14 @@ append_arg (int *index, LPWSTR dir, LPWS
     {
       /* no dir prefix */
       dirlen = 0;
-      fullvalue = xmalloc ((vallen + 1) * sizeof(TCHAR));
+      fullvalue = (LPWSTR) xmalloc ((vallen + 1) * sizeof(TCHAR));
     }
   else
     {
       /* Add dir first */
       dirlen = _tcslen (dir);
 
-      fullvalue = xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
+      fullvalue = (LPWSTR) xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
       _tcscpy (fullvalue, dir);
     }
 
@@ -203,7 +203,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UN
 		     if (ldir != NULL)
 		       {
 			 int n = ldir - wargv[k] + 1;
-			 dir = xmalloc ((n + 1) * sizeof (TCHAR));
+			 dir = (LPWSTR) xmalloc ((n + 1) * sizeof (TCHAR));
 			 _tcsncpy (dir, wargv[k], n);
 			 dir[n] = _T('\0');
 		       }
Index: ada/seh_init.c
===================================================================
--- ada/seh_init.c	(Revision 194496)
+++ ada/seh_init.c	(Arbeitskopie)
@@ -91,7 +91,7 @@ __gnat_map_SEH (EXCEPTION_RECORD* Except
       */
       if ((ExceptionRecord->ExceptionInformation[1] & 3) != 0
 	  || IsBadCodePtr
-	  ((void *)(ExceptionRecord->ExceptionInformation[1] + 4096)))
+	  ((FARPROC)(ExceptionRecord->ExceptionInformation[1] + 4096)))
 	{
 	  *msg = "EXCEPTION_ACCESS_VIOLATION";
 	  return &program_error;
Comment 7 Rainer Emrich 2013-01-03 13:28:51 UTC
Patch posted to the ML http://gcc.gnu.org/ml/gcc-patches/2013-01/msg00114.html
Comment 8 Kai Tietz 2013-02-06 12:01:32 UTC
Author: ktietz
Date: Wed Feb  6 12:01:20 2013
New Revision: 195803

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195803
Log:
2013-02-06  Rainer Emrich  <rainer@emrich-ebersheim.de>

	PR target/52123
	* adaint.c (__gnat_check_OWNER_ACL): Cast from pointer via
	SECURITY_DESCRIPTOR *
	(__gnat_set_OWNER_ACL): Cast from DWORD to ACCESS_MODE
	(__gnat_portable_spawn): Fix cast to char* const*
	(add_handle): Cast from pointer via void **
	(add_handle): Cast from pointer via int *
	(__gnat_locate_exec_on_path): Cast from pointer via TCHAR *
	(__gnat_locate_exec_on_path): Cast from pointer via char *
	* initialize.c (append_arg): Cast from pointer via LPWSTR
	(__gnat_initialize): Cast from pointer via LPWSTR
	* seh_init.c (__gnat_map_SEH): Cast from pointer via FARPROC


Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/adaint.c
    trunk/gcc/ada/initialize.c
    trunk/gcc/ada/seh_init.c
Comment 9 Daniel Starke 2013-02-06 17:04:21 UTC
This will probably not fix all problems with ada on mingw.
My last tests with 4.7.2 made me also need to patch this:

diff -uart gcc-4.7.2-original/gcc/ada/tracebak.c gcc-4.7.2/gcc/ada/tracebak.c
--- gcc-4.7.2-original/gcc/ada/tracebak.c	2011-10-24 10:31:30 +0000
+++ gcc-4.7.2/gcc/ada/tracebak.c	2012-09-23 15:26:50 +0000
@@ -326,7 +326,7 @@
 
 #if defined (__WIN32)
 #include <windows.h>
-#define IS_BAD_PTR(ptr) (IsBadCodePtr((void *)ptr))
+#define IS_BAD_PTR(ptr) (IsBadCodePtr((FARPROC)ptr))
 #elif defined (sun)
 #define IS_BAD_PTR(ptr) ((unsigned long)ptr == -1UL)
 #else
Comment 10 Rainer Emrich 2013-02-06 17:20:53 UTC
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Am 06.02.2013 18:04, schrieb daniel.f.starke at freenet dot de:
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52123
> 
> --- Comment #9 from Daniel Starke <daniel.f.starke at freenet dot de>
> 2013-02-06 17:04:21 UTC --- This will probably not fix all problems with
> ada on mingw.
Ah, I see. I missed this one because I only test for x86_64 and this one is in
the i386 path.

That's a problem in trunk and 4.7.3. I will prepare an additional patch for
trunk. Afterwards I will backport the whole mess to 4.7.3.
If you are able to test on 32 bit mingw system, I would like to send you the
patch for testing.


> My last tests with 4.7.2 made me also need to patch this:
> 
> diff -uart gcc-4.7.2-original/gcc/ada/tracebak.c
> gcc-4.7.2/gcc/ada/tracebak.c --- gcc-4.7.2-original/gcc/ada/tracebak.c
> 2011-10-24 10:31:30 +0000 +++ gcc-4.7.2/gcc/ada/tracebak.c    2012-09-23
> 15:26:50 +0000 @@ -326,7 +326,7 @@
> 
> #if defined (__WIN32) #include <windows.h> -#define IS_BAD_PTR(ptr)
> (IsBadCodePtr((void *)ptr)) +#define IS_BAD_PTR(ptr)
> (IsBadCodePtr((FARPROC)ptr)) #elif defined (sun) #define IS_BAD_PTR(ptr)
> ((unsigned long)ptr == -1UL) #else
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJREpDZAAoJEB3HOsWs+KJbFpMH/3soc7VszmDTzIMILkxSQARC
5kP/1clKrAmWjlIRSdt6CUjTDEmKrPGiWtmxqA9cuLq2AWkT1d2qycLNMq7cIeV5
4KNsMtqIKLfpFj7rw7n8gK8rCxMgUfXi+vBqFJtsGO1pBXtTZDgNsTlg5jqqUeeT
3744GGduKB702YbCsQYyiqjWffJeWcCYfMqHjZdu2xQNHhL69EX8GzAcZp1cHQJj
kPjfwPU2aaNYKD9H2DdhJ8S6Y8YWNg7UrYCUNY1ySKMeIx9OFamCHSUzZDC8e4kq
L4XKqIpZFz6Ys9qJDfv5o47lIoWmERy1aGH54fG2sX/xDdpHOv6q60vdGFCSDU4=
=W5RJ
-----END PGP SIGNATURE-----
Comment 11 Kai Tietz 2013-02-14 08:45:16 UTC
Author: ktietz
Date: Thu Feb 14 08:45:09 2013
New Revision: 196046

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196046
Log:
2013-02-14  Rainer Emrich  <rainer@emrich-ebersheim.de>

        PR target/52123
        * adaint.c (__gnat_check_OWNER_ACL): Cast from pointer via
        SECURITY_DESCRIPTOR *.
        (__gnat_set_OWNER_ACL): Cast from DWORD to ACCESS_MODE.
        (__gnat_portable_spawn): Fix cast to char* const*.
        (add_handle): Cast from pointer via void **.
        (add_handle): Cast from pointer via int *.
        (__gnat_locate_exec_on_path): Cast from pointer via TCHAR *.
        (__gnat_locate_exec_on_path): Cast from pointer via char *.
        * initialize.c (append_arg): Cast from pointer via LPWSTR.
        (__gnat_initialize): Cast from pointer via LPWSTR.
        * seh_init.c (__gnat_SEH_error_handler): Cast from pointer via FARPROC.
        * tracebak.c: Cast from pointer via FARPROC.

Modified:
    branches/gcc-4_7-branch/gcc/ada/ChangeLog
    branches/gcc-4_7-branch/gcc/ada/adaint.c
    branches/gcc-4_7-branch/gcc/ada/initialize.c
    branches/gcc-4_7-branch/gcc/ada/seh_init.c
    branches/gcc-4_7-branch/gcc/ada/tracebak.c
Comment 12 Kai Tietz 2013-02-14 13:04:15 UTC
Author: ktietz
Date: Thu Feb 14 13:04:10 2013
New Revision: 196051

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196051
Log:
2013-02-14  Rainer Emrich  <rainer@emrich-ebersheim.de>

        PR target/52123
        * tracebak.c: Cast from pointer via FARPROC.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/tracebak.c
Comment 13 Daniel Starke 2013-02-16 12:41:42 UTC
I just tried out to bootstrap r196092 on mingw32. There is still one more cast patch missing to make it work for that target.

diff -uart gcc-4.8.0-r196092/gcc/ada/seh_init.c gcc-4.8.0/gcc/ada/seh_init.c
--- gcc-4.8.0-r196092/gcc/ada/seh_init.c	2013-02-16 08:26:53 +0000
+++ gcc-4.8.0/gcc/ada/seh_init.c	2013-02-06 12:01:20 +0000
@@ -198,7 +198,7 @@
 #endif
 
   Raise_From_Signal_Handler (exception, msg);
-  return 0; /* This is never reached, avoid compiler warning  */
+  return (EXCEPTION_DISPOSITION)0; /* This is never reached, avoid compiler warning  */
 }
 #endif /* !(defined (_WIN64) && defined (__SEH__)) */
Comment 14 Eric Botcazou 2013-02-16 13:45:48 UTC
> I just tried out to bootstrap r196092 on mingw32. There is still one more cast
> patch missing to make it work for that target.
> 
> diff -uart gcc-4.8.0-r196092/gcc/ada/seh_init.c gcc-4.8.0/gcc/ada/seh_init.c
> --- gcc-4.8.0-r196092/gcc/ada/seh_init.c    2013-02-16 08:26:53 +0000
> +++ gcc-4.8.0/gcc/ada/seh_init.c    2013-02-06 12:01:20 +0000
> @@ -198,7 +198,7 @@
>  #endif
> 
>    Raise_From_Signal_Handler (exception, msg);
> -  return 0; /* This is never reached, avoid compiler warning  */
> +  return (EXCEPTION_DISPOSITION)0; /* This is never reached, avoid compiler
> warning  */
>  }
>  #endif /* !(defined (_WIN64) && defined (__SEH__)) */

That's ugly, please use ATTRIBUTE_NORETURN instead.
Comment 15 Cesar Strauss 2013-03-07 23:03:52 UTC
(In reply to comment #14)
> > I just tried out to bootstrap r196092 on mingw32. There is still one more cast
> > patch missing to make it work for that target.
> > 
> > diff -uart gcc-4.8.0-r196092/gcc/ada/seh_init.c gcc-4.8.0/gcc/ada/seh_init.c
> > --- gcc-4.8.0-r196092/gcc/ada/seh_init.c    2013-02-16 08:26:53 +0000
> > +++ gcc-4.8.0/gcc/ada/seh_init.c    2013-02-06 12:01:20 +0000
> > @@ -198,7 +198,7 @@
> >  #endif
> > 
> >    Raise_From_Signal_Handler (exception, msg);
> > -  return 0; /* This is never reached, avoid compiler warning  */
> > +  return (EXCEPTION_DISPOSITION)0; /* This is never reached, avoid compiler
> > warning  */
> >  }
> >  #endif /* !(defined (_WIN64) && defined (__SEH__)) */
> 
> That's ugly, please use ATTRIBUTE_NORETURN instead.

How about this (tested on i686-pc-mingw32):

Index: seh_init.c
===================================================================
--- seh_init.c	(revision 196484)
+++ seh_init.c	(working copy)
@@ -60,7 +60,8 @@ extern struct Exception_Data _abort_sign
 
 #define Raise_From_Signal_Handler \
                       ada__exceptions__raise_from_signal_handler
-extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
+extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *)
+     ATTRIBUTE_NORETURN;
 
 
 #if defined (_WIN32)
@@ -72,7 +73,8 @@ extern void Raise_From_Signal_Handler (s
 extern void _global_unwind2 (void *);
 
 EXCEPTION_DISPOSITION __gnat_SEH_error_handler
-(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*)
+     ATTRIBUTE_NORETURN;
 
 struct Exception_Data *
 __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg);
@@ -198,7 +200,6 @@ __gnat_SEH_error_handler (struct _EXCEPT
 #endif
 
   Raise_From_Signal_Handler (exception, msg);
-  return 0; /* This is never reached, avoid compiler warning  */
 }
 #endif /* !(defined (_WIN64) && defined (__SEH__)) */
Comment 16 Eric Botcazou 2013-03-08 08:04:07 UTC
Author: ebotcazou
Date: Fri Mar  8 08:04:00 2013
New Revision: 196536

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196536
Log:
	PR ada/52123
	* seh_init.c (Raise_From_Signal_Handler): Declare as no-return.
	(__gnat_SEH_error_handler): Likewise.  Remove final return.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/seh_init.c
Comment 17 Eric Botcazou 2013-03-08 08:04:32 UTC
Author: ebotcazou
Date: Fri Mar  8 08:04:22 2013
New Revision: 196537

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196537
Log:
	PR ada/52123
	* seh_init.c (Raise_From_Signal_Handler): Declare as no-return.
	(__gnat_SEH_error_handler): Likewise.  Remove final return.

Modified:
    branches/gcc-4_7-branch/gcc/ada/ChangeLog
    branches/gcc-4_7-branch/gcc/ada/seh_init.c
Comment 18 Eric Botcazou 2013-03-08 08:09:08 UTC
Thanks for the patch, applied.  Reopen if there are remaining issues.