Commit 255fb521 authored by Shenghou Ma's avatar Shenghou Ma

cmd/dist: add -Wstrict-prototypes to CFLAGS and fix all the compiler errors

Plan 9 compilers insist this but as we don't have Plan 9
builders, we'd better let gcc check the prototypes.

Inspired by CL 7289050.

R=golang-dev, seed, dave, rsc, lucio.dere
CC=akumar, golang-dev
https://golang.org/cl/7288056
parent dff017ea
......@@ -84,7 +84,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*);
void genconv(Type*, Type*);
void allocparams(void);
void checklabels();
void checklabels(void);
void ginscall(Node*, int);
/*
......
......@@ -80,7 +80,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*);
void genconv(Type*, Type*);
void allocparams(void);
void checklabels();
void checklabels(void);
void ginscall(Node*, int);
int gen_as_init(Node*);
void clearslim(Node*);
......
......@@ -93,7 +93,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*);
void genconv(Type*, Type*);
void allocparams(void);
void checklabels();
void checklabels(void);
void ginscall(Node*, int);
/*
......
......@@ -398,6 +398,9 @@ setup(void)
// gccargs is the gcc command line to use for compiling a single C file.
static char *proto_gccargs[] = {
"-Wall",
// native Plan 9 compilers don't like non-standard prototypes
// so let gcc catch them.
"-Wstrict-prototypes",
"-Wno-sign-compare",
"-Wno-missing-braces",
"-Wno-parentheses",
......
......@@ -182,7 +182,7 @@ void Lflag(char *arg);
void usage(void);
void adddynrel(Sym*, Reloc*);
void adddynrela(Sym*, Sym*, Reloc*);
Sym* lookuprel();
Sym* lookuprel(void);
void ldobj1(Biobuf *f, char*, int64 len, char *pn);
void ldobj(Biobuf*, char*, int64, char*, int);
void ldelf(Biobuf*, char*, int64, char*);
......
......@@ -50,7 +50,7 @@ struct MachoDebug {
uint32 filesize;
};
MachoHdr* getMachoHdr();
MachoHdr* getMachoHdr(void);
MachoSeg* newMachoSeg(char*, int);
MachoSect* newMachoSect(MachoSeg*, char*);
MachoLoad* newMachoLoad(uint32, uint32);
......
......@@ -426,14 +426,14 @@ addppword(uvlong pc)
}
void
startpptrace()
startpptrace(void)
{
ppstart = nppdata;
addppword(~0);
}
void
endpptrace()
endpptrace(void)
{
ppdata[ppstart] = nppdata-ppstart-1;
}
......@@ -644,7 +644,7 @@ compareleaf(const void *va, const void *vb)
}
void
dumphistogram()
dumphistogram(void)
{
int i, h, n;
PC *x;
......@@ -699,7 +699,7 @@ struct Trace {
};
void
dumppprof()
dumppprof(void)
{
uvlong i, n, *p, *e;
int ntrace;
......
......@@ -751,7 +751,7 @@ havet:
static void*
excthread(void *v)
{
extern boolean_t exc_server();
extern boolean_t exc_server(mach_msg_header_t *, mach_msg_header_t *);
mach_msg_server(exc_server, 2048, excport, 0);
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment