From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 360 invoked by alias); 13 Feb 2013 18:09:54 -0000 Received: (qmail 320 invoked by uid 22791); 13 Feb 2013 18:09:52 -0000 X-SWARE-Spam-Status: No, hits=0.9 required=5.0 tests=AWL,BAYES_50,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE,SPF_HELO_PASS,TBIRD_SPOOF,TW_CP X-Spam-Check-By: sourceware.org Received: from moutng.kundenserver.de (HELO moutng.kundenserver.de) (212.227.17.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 13 Feb 2013 18:09:44 +0000 Received: from matterhorn.local.emrich-ebersheim.de (95-89-187-4-dynip.superkabel.de [95.89.187.4]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0Md4Bm-1UMfOZ3S7u-00IF8l; Wed, 13 Feb 2013 19:09:42 +0100 Received: from localhost (localhost [127.0.0.1]) by matterhorn.local.emrich-ebersheim.de (Postfix) with ESMTP id 77A286000C1; Wed, 13 Feb 2013 19:09:41 +0100 (CET) Received: from matterhorn.local.emrich-ebersheim.de ([127.0.0.1]) by localhost (matterhorn.local.emrich-ebersheim.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tS7Rcmhvtstf; Wed, 13 Feb 2013 19:09:11 +0100 (CET) Received: from [192.168.0.13] (kasandra.local.emrich-ebersheim.de [192.168.0.13]) by matterhorn.local.emrich-ebersheim.de (Postfix) with ESMTP id BDAB7600D33; Wed, 13 Feb 2013 19:09:11 +0100 (CET) Message-ID: <511BD6C7.80000@emrich-ebersheim.de> Date: Wed, 13 Feb 2013 18:09:00 -0000 From: Rainer Emrich User-Agent: Mozilla/5.0 (Windows NT 5.2; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Arnaud Charlet , Kai Tietz Subject: [PATCH] : Fix for PR 52123 backport for gcc-4.7.3 OpenPGP: url=random.sks.keyserver.penguin.de Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2013-02/txt/msg00629.txt.bz2 Backport to 4.7.3, tested on i686-w64-mingw32, x86_64-w64-mingw32 and x86_64-unknown-gnu-linux. OK to apply? Rainer 2013-02-13 Rainer Emrich 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 Index: ada/adaint.c =================================================================== --- ada/adaint.c (revision 195803) +++ ada/adaint.c (working copy) @@ -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: ada/initialize.c =================================================================== --- ada/initialize.c (revision 195803) +++ ada/initialize.c (working copy) @@ -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 195803) +++ ada/seh_init.c (working copy) @@ -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: ada/tracebak.c =================================================================== --- ada/tracebak.c (revision 195803) +++ ada/tracebak.c (working copy) @@ -326,7 +326,7 @@ struct layout #if defined (__WIN32) #include -#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