summaryrefslogtreecommitdiff
blob: 66bc89d0c261e5d970a16f366a093cbab910c30f (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
Since clang16 implicit function declarations and implicit integers
result in a compilation error.

Bug: https://bugs.gentoo.org/882307 
Patch has been sent upstream via mail

Pascal Jäger <pascal.jaeger@leimstift.de> (2023-10-03)

--- a/clockspeed.c
+++ b/clockspeed.c
@@ -1,6 +1,7 @@
+#include <stdio.h>
+#include <sys/stat.h>
 #include <sys/types.h>
 #include <sys/time.h>
-#include "readwrite.h"
 #include "exit.h"
 #include "select.h"
 #include "scan.h"
@@ -11,11 +12,12 @@
 #include "error.h"
 #include "auto_home.h"
 #include "timing.h"
+#include "unistd.h"
 
 #ifndef HASRDTSC
 #ifndef HASGETHRTIME
 
-  Error! Need an unadjusted hardware clock.
+#error Need an unadjusted hardware clock.
 
 #endif
 #endif
--- a/clockview.c
+++ b/clockview.c
@@ -1,3 +1,4 @@
+#include <sys/time.h>
 #include <sys/types.h>
 #include <time.h>
 #include "substdio.h"
--- a/hier.c
+++ b/hier.c
@@ -1,5 +1,24 @@
 #include "auto_home.h"
 
+extern void h(char *home,
+int uid,
+int gid,
+int mode);
+
+extern void d(char *home,
+char *subdir,
+int uid,
+int gid,
+int mode);
+
+extern void c(
+char *home,
+char *subdir,
+char *file,
+int uid,
+int gid,
+int mode);
+
 void hier()
 {
   d("/var/lib","clockspeed",-1,-1,0755);
--- a/install.c
+++ b/install.c
@@ -2,8 +2,9 @@
 #include "strerr.h"
 #include "error.h"
 #include "open.h"
-#include "readwrite.h"
 #include "exit.h"
+#include <sys/stat.h>
+#include <unistd.h>
 
 extern void hier();
 
--- a/instcheck.c
+++ b/instcheck.c
@@ -2,8 +2,9 @@
 #include <sys/stat.h>
 #include "strerr.h"
 #include "error.h"
-#include "readwrite.h"
 #include "exit.h"
+#include <sys/stat.h>
+#include <unistd.h>
 
 extern void hier();
 
--- a/leapsecs_read.c
+++ b/leapsecs_read.c
@@ -1,7 +1,9 @@
+#include <stdlib.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <errno.h>
+#include <unistd.h>
 #include "tai.h"
 #include "leapsecs.h"
 
--- a/sntpclock.c
+++ b/sntpclock.c
@@ -3,12 +3,12 @@
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <unistd.h>
 #include "strerr.h"
 #include "ip.h"
 #include "str.h"
 #include "byte.h"
 #include "substdio.h"
-#include "readwrite.h"
 #include "select.h"
 #include "scan.h"
 #include "leapsecs.h"
@@ -79,7 +79,7 @@ int flagleap;
 }
 
 char outbuf[16];
-substdio ssout = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf);
+substdio ssout = SUBSTDIO_FDBUF((int(*)())write,1,outbuf,sizeof outbuf);
 
 #define FATAL "sntpclock: fatal: "
 #define WARNING "sntpclock: warning: "
--- a/taiclock.c
+++ b/taiclock.c
@@ -3,17 +3,17 @@
 #include <sys/param.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
+#include <unistd.h>
 #include "strerr.h"
 #include "ip.h"
 #include "str.h"
 #include "byte.h"
 #include "substdio.h"
-#include "readwrite.h"
 #include "select.h"
 #include "taia.h"
 
 char outbuf[16];
-substdio ssout = SUBSTDIO_FDBUF(write,1,outbuf,sizeof outbuf);
+substdio ssout = SUBSTDIO_FDBUF((int(*)())write,1,outbuf,sizeof outbuf);
 
 #define FATAL "taiclock: fatal: "
 #define WARNING "taiclock: warning: "

--- a/auto-str.c
+++ b/auto-str.c
@@ -5,7 +5,7 @@
 char buf1[256];
 substdio ss1 = SUBSTDIO_FDBUF(write,1,buf1,sizeof(buf1));
 
-void puts(s)
+void myputs(s)
 char *s;
 {
   if (substdio_puts(&ss1,s) == -1) _exit(111);
@@ -25,20 +25,20 @@ char **argv;
   value = argv[2];
   if (!value) _exit(100);
 
-  puts("char ");
-  puts(name);
-  puts("[] = \"\\\n");
+  myputs("char ");
+  myputs(name);
+  myputs("[] = \"\\\n");
 
   while (ch = *value++) {
-    puts("\\");
+    myputs("\\");
     octal[3] = 0;
     octal[2] = '0' + (ch & 7); ch >>= 3;
     octal[1] = '0' + (ch & 7); ch >>= 3;
     octal[0] = '0' + (ch & 7);
-    puts(octal);
+    myputs(octal);
   }
 
-  puts("\\\n\";\n");
+  myputs("\\\n\";\n");
   if (substdio_flush(&ss1) == -1) _exit(111);
   _exit(0);
 }
--- a/trygethr.c
+++ b/trygethr.c
@@ -1,7 +1,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 
-main()
+int main()
 {
   hrtime_t t;
 
--- a/tryrdtsc.c
+++ b/tryrdtsc.c
@@ -1,4 +1,6 @@
-main()
+#include <unistd.h>
+
+int main()
 {
   unsigned long x[2];
   unsigned long y[2];