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 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
Description: Fix missing/conflicting function declarations
Author: Bastian Germann <bage@debian.org>
Bug-Debian: https://bugs.debian.org/1075226
---
--- a/ld/dumps.c
+++ b/ld/dumps.c
@@ -7,6 +7,7 @@
#include "obj.h"
#include "type.h"
#include "globvar.h"
+#include <string.h>
/* print list of modules and whether they are loaded */
--- a/unproto/Makefile
+++ b/unproto/Makefile
@@ -83,7 +83,7 @@
CFLAGS = -O2 -pipe -Wall -Wextra -pedantic
LDFLAGS =
-CCFLAGS = $(CFLAGS) -w $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DREOPEN
+CCFLAGS = $(CFLAGS) -w $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DREOPEN -Wno-error=implicit-function-declaration
#CFLAGS = -O $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -p -Dstatic=
#CFLAGS = -g $(PIPE) $(SKIP) $(BELL) $(MAP) $(ALIAS) -DDEBUG
--- a/unproto/tok_io.c
+++ b/unproto/tok_io.c
@@ -89,7 +89,7 @@
#include "vstring.h"
#include "error.h"
-extern char *strsave(); /* XXX need include file */
+extern char *strsave(char *); /* XXX need include file */
/* Stuff to keep track of original source file name and position */
@@ -104,12 +104,12 @@
/* Forward declarations */
-static int read_quoted();
-static void read_comment();
-static int backslash_newline();
-static char *read_hex();
-static char *read_octal();
-static void fix_line_control();
+static int read_quoted(register struct vstring *vs, int ch);
+static void read_comment(register struct vstring *vs);
+static int backslash_newline(void);
+static char *read_hex(struct vstring *vs, register char *cp);
+static char *read_octal(register struct vstring *vs, register char *cp, register int c);
+static void fix_line_control(register char *path, register int line);
/*
* Character input with one level of pushback. The INPUT() macro recursively
--- a/unproto/token.h
+++ b/unproto/token.h
@@ -27,11 +27,11 @@
/* Input/output functions and macros */
extern struct token *tok_get(); /* read next single token */
-extern void tok_show(); /* display (composite) token */
+extern void tok_show(register struct token *t); /* display (composite) token */
extern struct token *tok_class(); /* classify tokens */
-extern void tok_unget(); /* stuff token back into input */
+extern void tok_unget(struct token *); /* stuff token back into input */
extern void put_nl(); /* print newline character */
-extern void tok_show_ch(); /* emit single-character token */
+extern void tok_show_ch(struct token *); /* emit single-character token */
#define tok_flush(t) (tok_show(t), tok_free(t))
@@ -46,7 +46,7 @@
/* Memory management */
struct token *tok_alloc(); /* allocate token storage */
-extern void tok_free(); /* re-cycle storage */
+extern void tok_free(register struct token *t); /* re-cycle storage */
/* Context */
--- a/unproto/error.c
+++ b/unproto/error.c
@@ -52,8 +52,7 @@
/* C library */
#include <stdio.h>
-
-extern void exit();
+#include <stdlib.h>
/* Application-specific stuff */
--- a/unproto/error.h
+++ b/unproto/error.h
@@ -1,6 +1,6 @@
/* @(#) error.h 1.2 92/01/15 21:53:14 */
extern int errcount; /* error counter */
-extern void error(); /* default context */
-extern void error_where(); /* user-specified context */
-extern void fatal(); /* fatal error */
+extern void error(char *); /* default context */
+extern void error_where(char *, int, char *); /* user-specified context */
+extern void fatal(char *); /* fatal error */
--- a/unproto/strsave.c
+++ b/unproto/strsave.c
@@ -26,9 +26,9 @@
/* C library */
#include <string.h>
+#include <stdlib.h>
extern int hash(register char *s, unsigned size);
-extern char *malloc();
/* Application-specific stuff */
--- a/unproto/symbol.c
+++ b/unproto/symbol.c
@@ -43,9 +43,9 @@
/* C library */
#include <string.h>
+#include <stdlib.h>
extern int hash(register char *s, unsigned size);
-extern char *malloc();
/* Application-specific stuff */
--- a/unproto/symbol.h
+++ b/unproto/symbol.h
@@ -6,6 +6,6 @@
struct symbol *next;
};
-extern void sym_enter(); /* add symbol to table */
-extern struct symbol *sym_find(); /* locate symbol */
+extern void sym_enter(char *, int); /* add symbol to table */
+extern struct symbol *sym_find(char *); /* locate symbol */
extern void sym_init(); /* prime the table */
--- a/unproto/tok_class.c
+++ b/unproto/tok_class.c
@@ -50,9 +50,7 @@
#include <stdio.h>
#include <string.h>
-
-extern long time();
-extern char* ctime();
+#include <time.h>
/* Application-specific stuff */
@@ -61,13 +59,13 @@
#include "token.h"
#include "symbol.h"
-static struct token *tok_list();
-static void tok_list_struct();
-static void tok_list_append();
-static void tok_strcat();
-static void tok_time();
-static void tok_date();
-static void tok_space_append();
+static struct token *tok_list(struct token *t);
+static void tok_list_struct(register struct token *list, register struct token *t);
+static void tok_list_append(struct token *h, struct token *t);
+static void tok_strcat(register struct token *t1);
+static void tok_time(struct token *t);
+static void tok_date(struct token *t);
+static void tok_space_append(register struct token *list, register struct token *t);
#if defined(MAP_VOID_STAR) || defined(MAP_VOID)
static void tok_void(); /* rewrite void keyword */
--- a/unproto/tok_pool.c
+++ b/unproto/tok_pool.c
@@ -37,7 +37,7 @@
/* C library */
-extern char *malloc();
+#include <stdlib.h>
/* Application-specific stuff */
--- a/unproto/unproto.c
+++ b/unproto/unproto.c
@@ -139,11 +139,8 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-
-extern void exit();
-extern int optind;
-extern char *optarg;
-extern int getopt();
+#include <stdlib.h>
+#include <unistd.h>
/* Application-specific stuff */
@@ -159,16 +156,16 @@
/* Forward declarations. */
-static struct token *dcl_flush();
-static void block_flush();
+static struct token *dcl_flush(struct token *);
+static void block_flush(struct token *);
static void block_dcls();
-static struct token *show_func_ptr_type();
-static struct token *show_struct_type();
-static void show_arg_name();
-static void show_type();
-static void pair_flush();
-static void check_cast();
-static void show_empty_list();
+static struct token *show_func_ptr_type(struct token *, struct token *);
+static struct token *show_struct_type(struct token *);
+static void show_arg_name(struct token *);
+static void show_type(struct token *);
+static void pair_flush(struct token *, int, int);
+static void check_cast(struct token *);
+static void show_empty_list(struct token *);
#define check_cast_flush(t) (check_cast(t), tok_free(t))
--- a/unproto/vstring.c
+++ b/unproto/vstring.c
@@ -67,8 +67,7 @@
/* C library */
-extern char *malloc();
-extern char *realloc();
+#include <stdlib.h>
/* Application-specific stuff */
--- a/unproto/vstring.h
+++ b/unproto/vstring.h
@@ -5,9 +5,9 @@
char *last; /* last position */
};
-extern struct vstring *vs_alloc(); /* initial allocation */
-extern char *vs_realloc(); /* string extension */
-extern char *vs_strcpy(); /* copy string */
+extern struct vstring *vs_alloc(int); /* initial allocation */
+extern char *vs_realloc(struct vstring *, char *); /* string extension */
+extern char *vs_strcpy(struct vstring *, char *, char *); /* copy string */
/* macro to add one character to auto-resized string */
--- a/elksemu/elks_sys.c
+++ b/elksemu/elks_sys.c
@@ -22,6 +22,7 @@
#include <sys/ioctl.h>
#include <dirent.h>
#include <sys/time.h>
+#include <sys/reboot.h>
#include "elks.h"
#include "efile.h"
@@ -656,11 +657,11 @@
switch(dx)
{
/* graceful shutdown, C-A-D off, kill -? 1 */
- case 0: return reboot(0xfee1dead, 672274793, 0);
+ case 0: return reboot(0);
/* Enable C-A-D */
- case 0xCAD: return reboot(0xfee1dead, 672274793, 0x89abcdef);
+ case 0xCAD: return reboot(0x89abcdef);
/* Time to die! */
- case 0xD1E: return reboot(0xfee1dead, 672274793, 0x1234567);
+ case 0xD1E: return reboot(0x1234567);
}
return -1;
}
|