summaryrefslogtreecommitdiff
path: root/dev-tcltk/tclx/files/tclx-8.4.4-gcc11.patch
blob: 6af41afd3ce3361ee7d0abe0abcde72944061d68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
--- a/generic/tclXfcntl.c	2023-03-15 19:34:15.074669138 +0100
+++ b/generic/tclXfcntl.c	2023-03-15 19:33:20.805545639 +0100
@@ -200,8 +200,12 @@
         value = (optValue == TCLX_BUFFERING_LINE);
         break;
       case ATTR_KEEPALIVE:
-        if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &value) != TCL_OK)
+        {
+        socklen_t len;
+        if (TclXOSgetsockopt (interp, channel, SO_KEEPALIVE, &len) != TCL_OK)
             return TCL_ERROR;
+        value = len;
+        }
         break;
       default:
         panic ("bug in fcntl get attrib");
--- a/generic/tclXhandles.c	2023-03-15 19:36:33.992425688 +0100
+++ b/generic/tclXhandles.c	2023-03-15 19:43:05.552120448 +0100
@@ -20,6 +20,9 @@
 
 #include "tclExtdInt.h"
 
+#include <stdint.h>
+#include <inttypes.h>
+
 /*
  * Variable set to contain the alignment factor (in bytes) for this machine.
  * It is set on the first table initialization.
@@ -539,7 +542,7 @@
 
     entryHdrPtr = HEADER_AREA (entryPtr);
     if (entryHdrPtr->freeLink != ALLOCATED_IDX)
-        panic ("Tcl_HandleFree: entry not allocated %x\n", entryHdrPtr);
+        panic ("Tcl_HandleFree: entry not allocated %" PRIxPTR "\n", (intptr_t)entryHdrPtr);
 
     entryHdrPtr->freeLink = tblHdrPtr->freeHeadIdx;
     tblHdrPtr->freeHeadIdx =
--- a/generic/tclXkeylist.c	2023-03-15 20:02:16.177763876 +0100
+++ b/generic/tclXkeylist.c	2023-03-15 20:04:46.029420986 +0100
@@ -17,6 +17,7 @@
  */
 
 #include "tclExtdInt.h"
+#include <stdint.h>
 
 /*
  * Keyed lists are stored as arrays recursively defined objects.  The data
@@ -338,7 +339,7 @@
     if (keylIntPtr->hashTbl != NULL) {
 	Tcl_HashEntry *entryPtr;
 	Tcl_HashSearch search;
-	int nidx;
+	intptr_t nidx;
 
 	entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl,
 		keylIntPtr->entries [entryIdx].key);
@@ -354,7 +355,7 @@
 	 */
 	for (entryPtr = Tcl_FirstHashEntry(keylIntPtr->hashTbl, &search);
 	     entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
-	    nidx = (int) Tcl_GetHashValue(entryPtr);
+	    nidx = (intptr_t) Tcl_GetHashValue(entryPtr);
 	    if (nidx > entryIdx) {
 		Tcl_SetHashValue(entryPtr, (ClientData) (uintptr_t) (nidx - 1));
 	    }
@@ -394,7 +395,8 @@
                     char	    **nextSubKeyPtr)
 {
     char *keySeparPtr;
-    int keyLen, findIdx = -1;
+    int keyLen;
+    intptr_t findIdx = -1;
 
     keySeparPtr = strchr (key, '.');
     if (keySeparPtr != NULL) {
@@ -416,7 +418,7 @@
 	}
 	entryPtr = Tcl_FindHashEntry(keylIntPtr->hashTbl, key);
 	if (entryPtr != NULL) {
-	    findIdx = (int) Tcl_GetHashValue(entryPtr);
+	    findIdx = (intptr_t) Tcl_GetHashValue(entryPtr);
 	}
 	if (keySeparPtr != NULL) {
 	    key[keyLen] = tmp;
--- a/generic/tclXsignal.c	2023-03-15 20:07:18.687031905 +0100
+++ b/generic/tclXsignal.c	2023-03-15 20:07:55.997447649 +0100
@@ -463,7 +463,7 @@
  *-----------------------------------------------------------------------------
  */
 static int
-BlockSignals (Tcl_Interp *interp, int action, unsigned char signals[])
+BlockSignals (Tcl_Interp *interp, int action, unsigned char signals[MAXSIG])
 {
 #ifndef NO_SIGACTION
     int      signalNum;
--- a/unix/tclXunixDup.c	2023-03-15 20:09:58.482528699 +0100
+++ b/unix/tclXunixDup.c	2023-03-15 20:13:22.981321777 +0100
@@ -17,6 +17,7 @@
  */
 
 #include "tclExtdInt.h"
+#include <stdint.h>
 
 
 /*-----------------------------------------------------------------------------
@@ -75,7 +76,8 @@
     ClientData handle;
     const Tcl_ChannelType *channelType;
     Tcl_Channel newChannel = NULL;
-    int srcFileNum, newFileNum = -1;
+    intptr_t srcFileNum;
+    int newFileNum = -1;
 
     /*
      * On Unix, the channels we can dup share the same file for the read and
@@ -86,7 +88,7 @@
     } else {
         Tcl_GetChannelHandle (srcChannel, TCL_WRITABLE, &handle);
     }
-    srcFileNum = (int) handle;
+    srcFileNum = (intptr_t) handle;
     channelType = Tcl_GetChannelType (srcChannel);
 
     /*
--- a/unix/tclXunixId.c	2023-03-15 20:14:58.037829847 +0100
+++ b/unix/tclXunixId.c	2023-03-15 20:15:50.699002979 +0100
@@ -444,7 +444,7 @@
 #endif
     char hostNameBuf[MAXHOSTNAMELEN];
 
-    if (objc != 2)
+	if (objc != 2)
         return TclX_WrongArgs (interp, objv [0], "host");
 
 	if (gethostname (hostNameBuf, MAXHOSTNAMELEN) < 0) {
--- a/unix/tclXunixOS.c	2023-03-15 20:16:27.021432520 +0100
+++ b/unix/tclXunixOS.c	2023-03-15 20:25:12.202242082 +0100
@@ -23,6 +23,7 @@
 
 #include "tclExtdInt.h"
 
+#include <stdint.h>
 #ifndef NO_GETPRIORITY
 #include <sys/resource.h>
 #endif
@@ -113,7 +114,7 @@
             return -1;
 	}
     }
-    return (int) handle;
+    return (intptr_t) handle;
 }
 
 /*-----------------------------------------------------------------------------
@@ -401,7 +402,7 @@
     if (pid == 0) {
         close (errPipes [0]);
         execl ("/bin/sh", "sh", "-c", command, (char *) NULL);
-        write (errPipes [1], &errno, sizeof (errno));
+        if(write (errPipes [1], &errno, sizeof (errno))) {};
         _exit (127);
     }
 
@@ -918,8 +919,9 @@
 int
 TclXOSgetsockname (Tcl_Interp *interp, Tcl_Channel channel, void *sockaddr, int sockaddrSize)
 {
+    socklen_t siz = sockaddrSize;
     if (getsockname (ChannelToFnum (channel, 0),
-		(struct sockaddr *) sockaddr, &sockaddrSize) < 0) {
+		(struct sockaddr *) sockaddr, &siz) < 0) {
 	TclX_AppendObjResult (interp, Tcl_GetChannelName (channel), ": ",
 		Tcl_PosixError (interp), (char *) NULL);
 	return TCL_ERROR;
@@ -943,7 +945,7 @@
 int
 TclXOSgetsockopt (Tcl_Interp *interp, Tcl_Channel channel, int option, socklen_t *valuePtr)
 {
-    int valueLen = sizeof (*valuePtr);
+    socklen_t valueLen = sizeof (*valuePtr);
 
     if (getsockopt (ChannelToFnum (channel, 0), SOL_SOCKET, option, 
 		(void*) valuePtr, &valueLen) != 0) {
@@ -1385,7 +1387,7 @@
                               (char *) NULL);
         return TCL_ERROR;
     }
-    *fnumPtr = (int) handle;
+    *fnumPtr = (intptr_t) handle;
     return TCL_OK;
 }