Skip to content

Commit ba1a923

Browse files
RainerEmrichKai Tietz
authored andcommitted
re PR ada/52123 (gcc bootstrap with ada fails on mingw target)
2013-02-06 Rainer Emrich <[email protected]> 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 From-SVN: r195803
1 parent 9bc44bf commit ba1a923

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

gcc/ada/ChangeLog

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
2013-02-06 Rainer Emrich <[email protected]>
2+
3+
PR target/52123
4+
* adaint.c (__gnat_check_OWNER_ACL): Cast from pointer via
5+
SECURITY_DESCRIPTOR *
6+
(__gnat_set_OWNER_ACL): Cast from DWORD to ACCESS_MODE
7+
(__gnat_portable_spawn): Fix cast to char* const*
8+
(add_handle): Cast from pointer via void **
9+
(add_handle): Cast from pointer via int *
10+
(__gnat_locate_exec_on_path): Cast from pointer via TCHAR *
11+
(__gnat_locate_exec_on_path): Cast from pointer via char *
12+
* initialize.c (append_arg): Cast from pointer via LPWSTR
13+
(__gnat_initialize): Cast from pointer via LPWSTR
14+
* seh_init.c (__gnat_map_SEH): Cast from pointer via FARPROC
15+
116
2013-02-06 Hristian Kirtchev <[email protected]>
217

318
* gcc-interface/Make-lang.in: Enable System.Stack_Checking.Operations

gcc/ada/adaint.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1982,7 +1982,7 @@ __gnat_check_OWNER_ACL
19821982
GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
19831983
NULL, 0, &nLength);
19841984

1985-
if ((pSD = (PSECURITY_DESCRIPTOR) HeapAlloc
1985+
if ((pSD = (SECURITY_DESCRIPTOR *) HeapAlloc
19861986
(GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL)
19871987
return 0;
19881988

@@ -2059,7 +2059,7 @@ __gnat_set_OWNER_ACL
20592059
return;
20602060

20612061
BuildExplicitAccessWithName
2062-
(&ea, username, AccessPermissions, AccessMode, NO_INHERITANCE);
2062+
(&ea, username, AccessPermissions, (ACCESS_MODE) AccessMode, NO_INHERITANCE);
20632063

20642064
if (AccessMode == SET_ACCESS)
20652065
{
@@ -2384,7 +2384,7 @@ __gnat_portable_spawn (char *args[])
23842384
strcat (args[0], args_0);
23852385
strcat (args[0], "\"");
23862386

2387-
status = spawnvp (P_WAIT, args_0, (const char* const*)args);
2387+
status = spawnvp (P_WAIT, args_0, (char* const*)args);
23882388

23892389
/* restore previous value */
23902390
free (args[0]);
@@ -2540,9 +2540,9 @@ add_handle (HANDLE h, int pid)
25402540
{
25412541
plist_max_length += 1000;
25422542
HANDLES_LIST =
2543-
xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
2543+
(void **) xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
25442544
PID_LIST =
2545-
xrealloc (PID_LIST, sizeof (int) * plist_max_length);
2545+
(int *) xrealloc (PID_LIST, sizeof (int) * plist_max_length);
25462546
}
25472547

25482548
HANDLES_LIST[plist_length] = h;
@@ -2931,7 +2931,7 @@ __gnat_locate_exec_on_path (char *exec_name)
29312931

29322932
#define EXPAND_BUFFER_SIZE 32767
29332933

2934-
wapath_val = alloca (EXPAND_BUFFER_SIZE);
2934+
wapath_val = (TCHAR *) alloca (EXPAND_BUFFER_SIZE);
29352935

29362936
wapath_val [0] = '.';
29372937
wapath_val [1] = ';';
@@ -2941,7 +2941,7 @@ __gnat_locate_exec_on_path (char *exec_name)
29412941

29422942
if (!res) wapath_val [0] = _T('\0');
29432943

2944-
apath_val = alloca (EXPAND_BUFFER_SIZE);
2944+
apath_val = (char *) alloca (EXPAND_BUFFER_SIZE);
29452945

29462946
WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE);
29472947
return __gnat_locate_exec (exec_name, apath_val);

gcc/ada/initialize.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ append_arg (int *index, LPWSTR dir, LPWSTR value,
8888
{
8989
/* no dir prefix */
9090
dirlen = 0;
91-
fullvalue = xmalloc ((vallen + 1) * sizeof(TCHAR));
91+
fullvalue = (LPWSTR) xmalloc ((vallen + 1) * sizeof(TCHAR));
9292
}
9393
else
9494
{
9595
/* Add dir first */
9696
dirlen = _tcslen (dir);
9797

98-
fullvalue = xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
98+
fullvalue = (LPWSTR) xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
9999
_tcscpy (fullvalue, dir);
100100
}
101101

@@ -203,7 +203,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
203203
if (ldir != NULL)
204204
{
205205
int n = ldir - wargv[k] + 1;
206-
dir = xmalloc ((n + 1) * sizeof (TCHAR));
206+
dir = (LPWSTR) xmalloc ((n + 1) * sizeof (TCHAR));
207207
_tcsncpy (dir, wargv[k], n);
208208
dir[n] = _T('\0');
209209
}

gcc/ada/seh_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg)
9191
*/
9292
if ((ExceptionRecord->ExceptionInformation[1] & 3) != 0
9393
|| IsBadCodePtr
94-
((void *)(ExceptionRecord->ExceptionInformation[1] + 4096)))
94+
((FARPROC)(ExceptionRecord->ExceptionInformation[1] + 4096)))
9595
{
9696
*msg = "EXCEPTION_ACCESS_VIOLATION";
9797
return &program_error;

0 commit comments

Comments
 (0)