summarylogtreecommitdiffstats
path: root/djgpp-djcrx-gcccompat.patch
blob: bbf28e93cc566bcbe209b0e82fb24aa5dc1dfa6c (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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
diff --git a/src/libc/ansi/locale/makefile b/src/libc/ansi/locale/makefile
index 517efc5..d8111b4 100644
--- a/src/libc/ansi/locale/makefile
+++ b/src/libc/ansi/locale/makefile
@@ -10,4 +10,6 @@ SRC += setlocal.c
 SRC += wcstombs.c
 SRC += wctomb.c
 
+setlocal.o: EXTRA_CFLAGS += -Wno-stringop-truncation
+
 include $(TOP)/../makefile.inc
diff --git a/src/libc/ansi/string/makefile b/src/libc/ansi/string/makefile
index 06cdfc7..6b88a2b 100644
--- a/src/libc/ansi/string/makefile
+++ b/src/libc/ansi/string/makefile
@@ -28,3 +28,5 @@ SRC += syserr2.c
 SRC += syserr3.c
 
 include $(TOP)/../makefile.inc
+
+strlen.o: EXTRA_CFLAGS += -fno-builtin-strlen
diff --git a/src/libc/c99/math/makefile b/src/libc/c99/math/makefile
index 366c60d..76dccc9 100644
--- a/src/libc/c99/math/makefile
+++ b/src/libc/c99/math/makefile
@@ -36,3 +36,7 @@ fp-asm.h: fp-asm.sed $(TOP)/../../include/math.h
 
 clean::
 	$(MISC) rm fp-asm.h
+
+nan.o: EXTRA_CFLAGS += -fno-builtin-nan
+nanf.o: EXTRA_CFLAGS += -fno-builtin-nanf
+nanl.o: EXTRA_CFLAGS += -fno-builtin-nanl
diff --git a/src/libc/compat/stdio/makefile b/src/libc/compat/stdio/makefile
index 19dd64a..de5e921 100644
--- a/src/libc/compat/stdio/makefile
+++ b/src/libc/compat/stdio/makefile
@@ -19,4 +19,6 @@ SRC += vscanf.c
 SRC += vfscanf.S
 SRC += vsscanf.c
 
+tempnam.o: EXTRA_CFLAGS += -Wno-stringop-truncation
+
 include $(TOP)/../makefile.inc
diff --git a/src/libc/compat/string/makefile b/src/libc/compat/string/makefile
index ea0b15b..0e07d43 100644
--- a/src/libc/compat/string/makefile
+++ b/src/libc/compat/string/makefile
@@ -22,3 +22,7 @@ SRC += strsep.c
 SRC += strupr.c
 
 include $(TOP)/../makefile.inc
+
+stpcpy.o:	EXTRA_CFLAGS += -fno-builtin-stpcpy
+stpncpy.o:	EXTRA_CFLAGS += -fno-builtin-stpncpy
+strdup.o:	EXTRA_CFLAGS += -fno-builtin-strdup
diff --git a/src/libc/compat/unistd/makefile b/src/libc/compat/unistd/makefile
index f62fdd0..0bcc395 100644
--- a/src/libc/compat/unistd/makefile
+++ b/src/libc/compat/unistd/makefile
@@ -27,4 +27,6 @@ SRC += usleep.c
 SRC += vfork.c
 SRC += xsymlink.c
 
+dirname.o: EXTRA_CFLAGS += -Wno-stringop-truncation
+
 include $(TOP)/../makefile.inc
diff --git a/src/libc/dos/process/dosexec.c b/src/libc/dos/process/dosexec.c
index e8361df..5f6eac0 100644
--- a/src/libc/dos/process/dosexec.c
+++ b/src/libc/dos/process/dosexec.c
@@ -406,7 +406,7 @@ direct_exec_tail_1 (const char *program, const char *args,
   if ((initial_tbuf_selector != tbuf_selector) && proxy_off)
   {
     char temp[65], *s, t2[5];
-    sprintf (t2, "%04lX", tbuf_beg>>4);
+    sprintf (t2, "%04X", (unsigned short)(tbuf_beg>>4));
     dosmemget (tbuf_beg+proxy_off, 64, temp);
     temp[64] = 0;
     s = strchr(temp,'\r');
@@ -1107,9 +1107,9 @@ static int go32_exec(const char *program, char **argv, char **envp)
   proxy_cmdline = (char *)alloca (34);
   
   sprintf(proxy_cmdline, "%s=%04x %04x %04x %04x %04x",
-    __PROXY, argc,
-   (unsigned)(tbuf_beg >> 4), rm_off & 0xffff,
-   (unsigned)(tbuf_beg >> 4), si_off & 0xffff);
+    __PROXY, (unsigned short)argc,
+    (unsigned short)(tbuf_beg >> 4), (unsigned short)(rm_off & 0xffff),
+    (unsigned short)(tbuf_beg >> 4), (unsigned short)(si_off & 0xffff));
   if (!found_si)
     proxy_cmdline[22] = 0; /* remove stubinfo information */
 
diff --git a/src/libc/dos/process/makefile b/src/libc/dos/process/makefile
index 8bd6fed..758e2aa 100644
--- a/src/libc/dos/process/makefile
+++ b/src/libc/dos/process/makefile
@@ -12,4 +12,6 @@ SRC += spawnv.c
 SRC += spawnvp.c
 SRC += spawnvpe.c
 
+dosexec.o: EXTRA_CFLAGS += -Wno-stringop-overflow
+
 include $(TOP)/../makefile.inc
diff --git a/src/libc/posix/string/makefile b/src/libc/posix/string/makefile
index a59b4dd..3bbb7c6 100644
--- a/src/libc/posix/string/makefile
+++ b/src/libc/posix/string/makefile
@@ -8,3 +8,6 @@ SRC += strndup.c
 SRC += strnlen.c
 
 include $(TOP)/../makefile.inc
+
+strndup.o:	EXTRA_CFLAGS += -fno-builtin-strndup
+strnlen.o:	EXTRA_CFLAGS += -Wno-nonnull-compare
diff --git a/src/libm/math/e_asin.c b/src/libm/math/e_asin.c
index 451b0b7..a590c9d 100644
--- a/src/libm/math/e_asin.c
+++ b/src/libm/math/e_asin.c
@@ -91,10 +91,10 @@ qS4 =  7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
 		if(huge+x>one) return x;/* return x with inexact if x!=0*/
 	    } else 
 		t = x*x;
-		p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
-		q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
-		w = p/q;
-		return x+x*w;
+	    p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+	    q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+	    w = p/q;
+	    return x+x*w;
 	}
 	/* 1> |x|>= 0.5 */
 	w = one-fabs(x);
diff --git a/src/libm/math/ef_asin.c b/src/libm/math/ef_asin.c
index 5cae619..6f03cc2 100644
--- a/src/libm/math/ef_asin.c
+++ b/src/libm/math/ef_asin.c
@@ -58,10 +58,10 @@ qS4 =  7.7038154006e-02; /* 0x3d9dc62e */
 		if(huge+x>one) return x;/* return x with inexact if x!=0*/
 	    } else 
 		t = x*x;
-		p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
-		q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
-		w = p/q;
-		return x+x*w;
+	    p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
+	    q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
+	    w = p/q;
+	    return x+x*w;
 	}
 	/* 1> |x|>= 0.5 */
 	w = one-fabsf(x);
diff --git a/src/libm/math/ef_jn.c b/src/libm/math/ef_jn.c
index f088110..eba3e49 100644
--- a/src/libm/math/ef_jn.c
+++ b/src/libm/math/ef_jn.c
@@ -20,7 +20,6 @@ static const float
 #else
 static float
 #endif
-invsqrtpi=  5.6418961287e-01, /* 0x3f106ebb */
 two   =  2.0000000000e+00, /* 0x40000000 */
 one   =  1.0000000000e+00; /* 0x3F800000 */
 
diff --git a/src/libm/math/k_rem_pio2.c b/src/libm/math/k_rem_pio2.c
index 8569256..4620187 100644
--- a/src/libm/math/k_rem_pio2.c
+++ b/src/libm/math/k_rem_pio2.c
@@ -187,7 +187,8 @@ twon24  =  5.96046447753906250000e-08; /* 0x3E700000, 0x00000000 */
 
     /* compute q[0],q[1],...q[jk] */
 	for (i=0;i<=jk;i++) {
-	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+	    q[i] = fw;
 	}
 
 	jz = jk;
diff --git a/src/libm/math/kf_rem_pio2.c b/src/libm/math/kf_rem_pio2.c
index 261c481..1573ca9 100644
--- a/src/libm/math/kf_rem_pio2.c
+++ b/src/libm/math/kf_rem_pio2.c
@@ -77,7 +77,8 @@ twon8  =  3.9062500000e-03; /* 0x3b800000 */
 
     /* compute q[0],q[1],...q[jk] */
 	for (i=0;i<=jk;i++) {
-	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw;
+	    for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j];
+	    q[i] = fw;
 	}
 
 	jz = jk;
diff --git a/src/libm/math/s_scalbn.c b/src/libm/math/s_scalbn.c
index c9e75c8..680d9e0 100644
--- a/src/libm/math/s_scalbn.c
+++ b/src/libm/math/s_scalbn.c
@@ -66,7 +66,6 @@ static double
 #endif
 two54   =  1.80143985094819840000e+16, /* 0x43500000, 0x00000000 */
 twom54  =  5.55111512312578270212e-17, /* 0x3C900000, 0x00000000 */
-huge   = 1.0e+300,
 tiny   = 1.0e-300;
 
 #ifdef __STDC__
diff --git a/src/libm/math/sf_cos.c b/src/libm/math/sf_cos.c
index 8f3a8af..9892a56 100644
--- a/src/libm/math/sf_cos.c
+++ b/src/libm/math/sf_cos.c
@@ -15,12 +15,6 @@
 
 #include "fdlibm.h"
 
-#ifdef __STDC__
-static const float one=1.0;
-#else
-static float one=1.0;
-#endif
-
 #ifdef __STDC__
 	float cosf(float x)
 #else
diff --git a/src/libm/math/sf_scalbn.c b/src/libm/math/sf_scalbn.c
index 1d27c80..b5d179e 100644
--- a/src/libm/math/sf_scalbn.c
+++ b/src/libm/math/sf_scalbn.c
@@ -29,7 +29,6 @@ static float
 #endif
 two25   =  3.355443200e+07,	/* 0x4c000000 */
 twom25  =  2.9802322388e-08,	/* 0x33000000 */
-huge   = 1.0e+30,
 tiny   = 1.0e-30;
 
 #ifdef __STDC__
diff --git a/src/utils/djtar/unlzh.c b/src/utils/djtar/unlzh.c
index e1cdc28..22f68ce 100644
--- a/src/utils/djtar/unlzh.c
+++ b/src/utils/djtar/unlzh.c
@@ -236,7 +236,8 @@ local void read_pt_len(int nn, int nbit, int i_special)
       {
         mask = (unsigned) 1 << (BITBUFSIZ - 1 - 3);
         while (mask & bitbuf)
-          mask >>= 1;  c++;
+          mask >>= 1;
+	c++;
       }
       fillbuf((c < 7) ? 3 : c - 3);
       pt_len[i++] = c;