1
0
mirror of https://github.com/golang/go synced 2024-11-12 09:50:21 -07:00

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
This commit is contained in:
Shenghou Ma 2013-02-05 21:43:04 +08:00
parent dff017ea99
commit 255fb521da
8 changed files with 13 additions and 10 deletions

View File

@ -84,7 +84,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*); int needconvert(Type*, Type*);
void genconv(Type*, Type*); void genconv(Type*, Type*);
void allocparams(void); void allocparams(void);
void checklabels(); void checklabels(void);
void ginscall(Node*, int); void ginscall(Node*, int);
/* /*

View File

@ -80,7 +80,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*); int needconvert(Type*, Type*);
void genconv(Type*, Type*); void genconv(Type*, Type*);
void allocparams(void); void allocparams(void);
void checklabels(); void checklabels(void);
void ginscall(Node*, int); void ginscall(Node*, int);
int gen_as_init(Node*); int gen_as_init(Node*);
void clearslim(Node*); void clearslim(Node*);

View File

@ -93,7 +93,7 @@ void cgen_dcl(Node*);
int needconvert(Type*, Type*); int needconvert(Type*, Type*);
void genconv(Type*, Type*); void genconv(Type*, Type*);
void allocparams(void); void allocparams(void);
void checklabels(); void checklabels(void);
void ginscall(Node*, int); void ginscall(Node*, int);
/* /*

View File

@ -398,6 +398,9 @@ setup(void)
// gccargs is the gcc command line to use for compiling a single C file. // gccargs is the gcc command line to use for compiling a single C file.
static char *proto_gccargs[] = { static char *proto_gccargs[] = {
"-Wall", "-Wall",
// native Plan 9 compilers don't like non-standard prototypes
// so let gcc catch them.
"-Wstrict-prototypes",
"-Wno-sign-compare", "-Wno-sign-compare",
"-Wno-missing-braces", "-Wno-missing-braces",
"-Wno-parentheses", "-Wno-parentheses",

View File

@ -182,7 +182,7 @@ void Lflag(char *arg);
void usage(void); void usage(void);
void adddynrel(Sym*, Reloc*); void adddynrel(Sym*, Reloc*);
void adddynrela(Sym*, Sym*, Reloc*); void adddynrela(Sym*, Sym*, Reloc*);
Sym* lookuprel(); Sym* lookuprel(void);
void ldobj1(Biobuf *f, char*, int64 len, char *pn); void ldobj1(Biobuf *f, char*, int64 len, char *pn);
void ldobj(Biobuf*, char*, int64, char*, int); void ldobj(Biobuf*, char*, int64, char*, int);
void ldelf(Biobuf*, char*, int64, char*); void ldelf(Biobuf*, char*, int64, char*);

View File

@ -50,7 +50,7 @@ struct MachoDebug {
uint32 filesize; uint32 filesize;
}; };
MachoHdr* getMachoHdr(); MachoHdr* getMachoHdr(void);
MachoSeg* newMachoSeg(char*, int); MachoSeg* newMachoSeg(char*, int);
MachoSect* newMachoSect(MachoSeg*, char*); MachoSect* newMachoSect(MachoSeg*, char*);
MachoLoad* newMachoLoad(uint32, uint32); MachoLoad* newMachoLoad(uint32, uint32);

View File

@ -426,14 +426,14 @@ addppword(uvlong pc)
} }
void void
startpptrace() startpptrace(void)
{ {
ppstart = nppdata; ppstart = nppdata;
addppword(~0); addppword(~0);
} }
void void
endpptrace() endpptrace(void)
{ {
ppdata[ppstart] = nppdata-ppstart-1; ppdata[ppstart] = nppdata-ppstart-1;
} }
@ -644,7 +644,7 @@ compareleaf(const void *va, const void *vb)
} }
void void
dumphistogram() dumphistogram(void)
{ {
int i, h, n; int i, h, n;
PC *x; PC *x;
@ -699,7 +699,7 @@ struct Trace {
}; };
void void
dumppprof() dumppprof(void)
{ {
uvlong i, n, *p, *e; uvlong i, n, *p, *e;
int ntrace; int ntrace;

View File

@ -751,7 +751,7 @@ havet:
static void* static void*
excthread(void *v) 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); mach_msg_server(exc_server, 2048, excport, 0);
return 0; return 0;
} }