qa: build everything with -Werror

This commit is contained in:
Giacomo Tesio 2017-01-10 01:37:55 +01:00
parent 51d12f1f34
commit e93aafc028
54 changed files with 58 additions and 145 deletions

View File

@ -14,6 +14,7 @@
"-O0",
"-static",
"-Wall",
"-Werror",
"-Wno-main",
"-Wno-missing-braces",
"-Wno-parentheses",

View File

@ -3,9 +3,6 @@
"Include": [
"/sys/src/cmd/cmd.json"
],
"CFlags": [
"-Werror"
],
"Projects": [
"win/"
],

View File

@ -3,9 +3,6 @@
"Include": [
"/sys/src/cmd/cmd.json"
],
"CFlags": [
"-Werror"
],
"Install": "/arch/$ARCH/aux/acme/",
"Program": "win",
"SourceFiles": [

View File

@ -3,9 +3,6 @@
"Include": [
"/sys/src/cmd/cmd.json"
],
"CFlags": [
"-Werror"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "acme",
"SourceFiles": [

View File

@ -11,8 +11,7 @@
"git clean -xdf ./"
],
"Cflags": [
"-DYYMALLOC=malloc",
"-Werror"
"-DYYMALLOC=malloc"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "awk",

View File

@ -16,6 +16,8 @@
#include "dosfs.h"
#include "fns.h"
extern int putlongname(Xfs *xf, Dosptr *ndp, char *name, char sname[13]);
void
rversion(void)
{

View File

@ -19,14 +19,14 @@
static Iotrack hiob[HIOB+1]; /* hash buckets + lru list */
static Iotrack iobuf[NIOBUF]; /* the real ones */
#define UNLINK(p, nx, pr) ((p)->pr->nx = (p)->nx, (p)->nx->pr = (p)->pr)
#define UNLINK(p, nx, pr) {(p)->pr->nx = (p)->nx; (p)->nx->pr = (p)->pr;}
#define LINK(h, p, nx, pr) ((p)->nx = (h)->nx, (p)->pr = (h), \
(h)->nx->pr = (p), (h)->nx = (p))
#define LINK(h, p, nx, pr) {(p)->nx = (h)->nx; (p)->pr = (h), \
(h)->nx->pr = (p); (h)->nx = (p);}
#define HTOFRONT(h, p) ((h)->hnext != (p) && (UNLINK(p,hnext,hprev), LINK(h,p,hnext,hprev)))
#define HTOFRONT(h, p) if((h)->hnext != (p)) { UNLINK(p,hnext,hprev); LINK(h,p,hnext,hprev); }
#define TOFRONT(h, p) ((h)->next != (p) && (UNLINK(p, next, prev), LINK(h,p, next, prev)))
#define TOFRONT(h, p) if((h)->next != (p)) { UNLINK(p, next, prev); LINK(h,p, next, prev); }
Iosect *
getsect(Xfs *xf, int32_t addr)

View File

@ -19,14 +19,16 @@ static Xfs *xhead;
static Xfile *xfiles[FIDMOD], *freelist;
static MLock xlock, xlocks[FIDMOD], freelock;
#if 0
static int
okmode(int omode, int fmode)
{
if(omode == OREAD)
return fmode & 4;
/* else ORDWR */
return (fmode & 6) == 6;
return (fmode & ORDWR) == ORDWR;
}
#endif
Xfs *
getxfs(char *user, char *name)
@ -56,7 +58,7 @@ getxfs(char *user, char *name)
offset = 0;
if(p = strrchr(name, ':')){
*p++ = 0;
offset = strtol(p, (const char **)&q, 0);
offset = strtol(p, &q, 0);
chat("name %s, offset %ld\n", p, offset);
if(offset < 0 || p == q){
errno = Enofilsys;

View File

@ -77,8 +77,8 @@ fcmp(const void *va, const void *vb)
Re **aa, **bb;
Re *a, *b;
aa = va;
bb = vb;
aa = (Re **)va;
bb = (Re **)vb;
a = *aa;
b = *bb;
if (a > b)
@ -199,7 +199,7 @@ int
pcmp(const void *va, const void *vb)
{
int n;
Rune *a, *b;
const Rune *a, *b;
a = va;
b = vb;

View File

@ -1,8 +1,5 @@
{
"Console": {
"Cflags": [
"-Werror"
],
"Include": [
"/arch/$ARCH/include/cflags.json"
],

View File

@ -1,8 +1,5 @@
{
"PipeConsole": {
"Cflags": [
"-Werror"
],
"Include": [
"/arch/$ARCH/include/cflags.json"
],

View File

@ -1,8 +1,5 @@
{
"ScreenConsole": {
"Cflags": [
"-Werror"
],
"Include": [
"/arch/$ARCH/include/cflags.json"
],

View File

@ -66,6 +66,7 @@ tvp3026xi(uint8_t index)
return r;
}
#if 0
static void
tvp3026o(uint8_t reg, uint8_t data)
{
@ -74,6 +75,7 @@ tvp3026o(uint8_t reg, uint8_t data)
crt55 = tvp3026io(reg, data);
vgaxo(Crtx, 0x55, crt55);
}
#endif
void
tvp3026xo(uint8_t index, uint8_t data)
@ -125,6 +127,7 @@ init(Vga* vga, Ctlr* ctlr)
ctlr->flag |= Finit;
}
#if 0
static void
load(Vga* vga, Ctlr* ctlr)
{
@ -147,6 +150,7 @@ load(Vga* vga, Ctlr* ctlr)
ctlr->flag |= Fload;
}
#endif
static void
dump(Vga* vga, Ctlr* ctlr)

View File

@ -144,7 +144,7 @@ dbvesamode(char *mode)
uint8_t *p, *ep;
Vmode vm;
Mode *m;
if(vbe == nil)
return nil;
@ -242,8 +242,8 @@ dump(Vga* vga, Ctlr* ctlr)
for(i=0x100; i<0x1FF; i++)
if(!did[i])
vbeprintmodeinfo(vbe, i, " (unoffered)");
if(vbeddcedid(vbe, &edid) < 0)
fprint(2, "warning: reading edid: %r\n");
else
@ -282,6 +282,7 @@ static Flag capabilityflag[] = {
0
};
#if 0
static Flag modeattributesflags[] = {
1<<0, "supported",
1<<2, "tty",
@ -310,6 +311,7 @@ static Flag directcolorflags[] = {
1<<1, "x-usable",
0
};
#endif
static char *modelstr[] = {
"text", "cga", "hercules", "planar", "packed", "non-chain4", "direct", "YUV"
@ -642,7 +644,7 @@ vbeddcedid(Vbe *vbe, Edid *e)
{
uint8_t *p;
VGAreg u;
p = vbesetup(vbe, &u, 0x4F15);
u.bx = 0x0001;
if(vbecall(vbe, &u) < 0)
@ -653,12 +655,12 @@ vbeddcedid(Vbe *vbe, Edid *e)
}
return 0;
}
void
printedid(Edid *e)
{
Modelist *l;
printitem("edid", "mfr");
Bprint(&stdout, "%s\n", e->mfr);
printitem("edid", "serialstr");
@ -685,7 +687,7 @@ printedid(Edid *e)
Bprint(&stdout, "%lud\n", e->pclkmax);
printitem("edid", "flags");
printflags(edidflags, e->flags);
for(l=e->modelist; l; l=l->next){
printitem("edid", l->name);
Bprint(&stdout, "\n\t\tclock=%g\n\t\tshb=%d ehb=%d ht=%d\n\t\tvrs=%d vre=%d vt=%d\n\t\thsync=%c vsync=%c %s\n",
@ -799,7 +801,7 @@ decodedtb(Mode *m, uint8_t *p)
m->ehs = ha+hb;
m->vt = va+vb;
m->vbs = va;
m->vbs = va;
m->vrs = va+vso;
m->vre = va+vso+vspw;
m->vbe = va+vb;
@ -811,7 +813,7 @@ decodedtb(Mode *m, uint8_t *p)
return -1;
/*
* Sync signal description. I have no idea how to properly handle the
* Sync signal description. I have no idea how to properly handle the
* first three cases, which I think are aimed at things other than
* canonical SVGA monitors.
*/
@ -902,7 +904,7 @@ parseedid128(Edid *e, void *v)
}
sum = 0;
for(i=0; i<128; i++)
for(i=0; i<128; i++)
sum += p[i];
if(sum != 0) {
werrstr("bad edid checksum");
@ -986,7 +988,7 @@ parseedid128(Edid *e, void *v)
*/
estab = (p[0]<<16) | (p[1]<<8) | p[2];
p += 3;
for(i=0, m=1<<23; i<nelem(estabtime); i++, m>>=1)
if(estab & m)
if(vesalookup(&mode, estabtime[i]) == 0)

View File

@ -58,7 +58,7 @@ enum {
Calphacursor = 1<<9,
Rpalette = 1024,
};
};
typedef struct Vmware Vmware;
struct Vmware {
@ -200,12 +200,13 @@ options(Vga* vga, Ctlr* ctlr)
ctlr->flag |= Hlinear|Henhanced|Foptions;
}
#if 0
static void
clock(Vga* vga, Ctlr* ctlr)
{
/* BEST CLOCK ROUTINE EVER! */
}
#endif
static void
init(Vga* vga, Ctlr* ctlr)
@ -281,7 +282,7 @@ dump(Vga* vga, Ctlr* ctlr)
printitem(ctlr->name, "depth");
Bprint(&stdout, " %d\n", vm->depth);
printitem(ctlr->name, "linear");
}
Ctlr vmware = {

View File

@ -55,7 +55,7 @@ stmt: expr { code(xpop); }
| RETURN expr
{ defnonly("return"); $$=$2; code(funcret); }
| PROCEDURE begin '(' arglist ')'
{ $$ = $2; code3(call, (Inst)$1, (Inst)$4); }
{ $$ = $2; code3(call, (Inst)$1, (Inst)(uintptr_t)$4); }
| PRINT prlist { $$ = $2; }
| while '(' cond ')' stmt end {
($1)[1] = (Inst)$5; /* body of loop */
@ -94,7 +94,7 @@ expr: NUMBER { $$ = code2(constpush, (Inst)$1); }
| VAR { $$ = code3(varpush, (Inst)$1, eval); }
| asgn
| FUNCTION begin '(' arglist ')'
{ $$ = $2; code3(call,(Inst)$1,(Inst)$4); }
{ $$ = $2; code3(call,(Inst)$1,(Inst)(uintptr_t)$4); }
| READ '(' VAR ')' { $$ = code2(varread, (Inst)$3); }
| BLTIN '(' expr ')' { $$=$3; code2(bltin, (Inst)$1->u.ptr); }
| '(' expr ')' { $$ = $2; }

View File

@ -55,6 +55,8 @@ void diag(Node*, char*, ...);
void com(Node*);
void fcom(Node*,Node*,Node*);
int yylex(void);
#pragma varargck argpos cprint 1
#pragma varargck argpos diag 2
@ -80,7 +82,7 @@ void fcom(Node*,Node*,Node*);
%left '^'
%right '('
%token <lval> MOD IF ELSE WHILE BREAK
%token <lval> MOD IF ELSE WHILE BREAK
%token <sval> NAME NUM
%%
@ -312,7 +314,7 @@ Loop:
if(getch() == '<') return LSH;
ungetc();
return '<';
case '>':
case '>':
if(getch() == '>') return RSH;
ungetc();
return '>';
@ -1051,7 +1053,7 @@ diag(Node *n, char *fmt, ...)
{
static char buf[1024];
va_list a;
va_start(a, fmt);
vsnprint(buf, sizeof(buf), fmt, a);
va_end(a);

View File

@ -10,9 +10,6 @@
"yacc -d syn.y",
"cp y.tab.h x.tab.h"
],
"Cflags": [
"-Wl,--verbose"
],
"Install": "/arch/$ARCH/cmd/",
"Program": "rc",
"SourceFiles": [

View File

@ -1,8 +1,7 @@
{
"Libusb": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"/sys/src/lib/lib.json"

View File

@ -9,7 +9,7 @@ fi
cd $JEHANNE/sys/src/kern/amd64
gcc -c -O0 -static -fplan9-extensions -mno-red-zone -ffreestanding -fno-builtin -mcmodel=kernel l64sipi.S
ld -Ttext 0x00003000 l64sipi.o -o l64sipi
ld -Ttext 0x00003000 -e 0x00003000 l64sipi.o -o l64sipi
objcopy -O binary -j .text l64sipi l64sipi.out
echo 'uint8_t sipihandler[]={' > sipi.h

View File

@ -21,7 +21,7 @@
#define __ASSEMBLER__
#endif
.section .text, "awx"
.section .text
/*
* Real mode. Welcome to 1978.
@ -205,7 +205,7 @@ _start64v:
_ndnr:
jmp _ndnr
.globl sipihandlerend
sipihandlerend:
jmp sipihandlerend

View File

@ -1,7 +1,6 @@
{
"lib9p": {
"Cflags": [
"-Werror",
"-DPORTABLE_SYSCALLS"
],
"Include": [

View File

@ -1,8 +1,7 @@
{
"9p2000": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../lib.json"

View File

@ -1,8 +1,7 @@
{
"9p2000": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../klib.json"

View File

@ -1,8 +1,5 @@
{
"libString": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,7 @@
{
"Libaml": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../lib.json"

View File

@ -1,8 +1,7 @@
{
"KernelLibaml": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../klib.json"

View File

@ -1,8 +1,5 @@
{
"libauth": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libauthsrv": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libavl": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libbio": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,7 @@
{
"CrtFiles": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../lib.json"
@ -18,8 +17,7 @@
},
"Libc": {
"Cflags": [
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../lib.json"

View File

@ -2,8 +2,7 @@
"KernelLibc": {
"Cflags": [
"-DKERNEL",
"-fasm",
"-Werror"
"-fasm"
],
"Include": [
"../klib.json"

View File

@ -1,8 +1,5 @@
{
"libcomplete": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libcontrol": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libdisk": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"Libdraw": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"KernelLibdraw": {
"Cflags": [
"-Werror"
],
"Include": [
"../klib.json"
],

View File

@ -1,8 +1,5 @@
{
"libflate": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libframe": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"Libip": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"KernelLibip": {
"Cflags": [
"-Werror"
],
"Include": [
"../klib.json"
],

View File

@ -1,8 +1,5 @@
{
"Libip": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -10,6 +10,7 @@
"-fstack-protector-all",
"-fno-builtin",
"-Wall",
"-Werror",
"-Wno-missing-braces",
"-Wno-parentheses",
"-Wno-unknown-pragmas",

View File

@ -1,8 +1,5 @@
{
"libmemdraw": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"KernelLibmemdraw": {
"Cflags": [
"-Werror"
],
"Include": [
"../klib.json"
],

View File

@ -1,8 +1,5 @@
{
"libmemlayer": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"KernelLibmemlayer": {
"Cflags": [
"-Werror"
],
"Include": [
"../klib.json"
],

View File

@ -1,8 +1,5 @@
{
"libplumb": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libregexp": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -4,8 +4,7 @@
"../lib.json"
],
"Cflags": [
"-I../mp/port/",
"-Werror"
"-I../mp/port/"
],
"Install": "/arch/$ARCH/lib/",
"Library": "libsec.a",

View File

@ -4,8 +4,7 @@
"../klib.json"
],
"Cflags": [
"-I../mp/port/",
"-Werror"
"-I../mp/port/"
],
"Install": "/arch/$ARCH/lib/",
"Library": "klibsec.a",

View File

@ -1,8 +1,5 @@
{
"libstdio": {
"Cflags": [
"-Werror"
],
"Include": [
"../lib.json"
],

View File

@ -1,8 +1,5 @@
{
"libthread": {
"Cflags": [
"-Werror"
],
"Include": [
"/arch/$ARCH/include/cflags.json",
"../lib.json"