hi Neil, I pulled wiggle's latest head from git and tried to compile on Mac
OS X. I ran into some problems when I tried to compile with -O3 without
-ggdb.
gcc -Werror treated some uninitialized variable warnings as errors. Some of
the warnings look like real bugs, but many were false positives. Compiling
with -O3 and -ggdb makes all the warnings "go away." :)
I've attached a patch to fix the following valid warnings:
cc1: warnings being treated as errors
parse.c: In function `parse_patch':
parse.c:268: warning: `c' may be used uninitialized in this function
vpatch.c: In function `next_melmnt':
vpatch.c:418: warning: `e.hash' may be used uninitialized in this function
vpatch.c: In function `prev_melmnt':
vpatch.c:472: warning: `e.hash' may be used uninitialized in this function
vpatch.c: In function `draw_mside':
vpatch.c:838: warning: `tag_attr' may be used uninitialized in this function
vpatch.c:837: warning: `tag' may be used uninitialized in this function
vpatch.c:1334: warning: `e' may be used uninitialized in this function
Signed-off-by: NeilBrown <neilb@suse.de>
You might like to inspect the Makefile and change
OptDbg=-ggdb
-to something that will compile faster code on your compter, such as
+to something that will compile faster code on your computer, such as
OptDbg=-O3 -march=pentium2
char *target = "\n+++ ";
char *target2 = "\n--- ";
char *pos = target;
- int c;
+ int c = EOF;
char name[1024];
unsigned start, end;
}
if (pos->m == -1 || m[pos->m].type == End) {
struct elmnt e;
- e.start = NULL; e.len = 0;
+ e.start = NULL; e.hash = 0; e.len = 0;
return e;
}
switch (pos->s) {
}
if (pos->m < 0) {
struct elmnt e;
- e.start = NULL; e.len = 0;
+ e.start = NULL; e.hash = 0; e.len = 0;
return e;
}
switch (pos->s) {
unsigned int tag_attr;
switch (pos.state) {
+ default: /* keep compiler happy */
case 0: /* unchanged line */
tag = ' ';
tag_attr = A_NORMAL;
char *e, e2[7];
int i;
switch (vpos.p.s) {
+ default: /* keep compiler happy */
case 0:
e = fm.list[ci.merger[vpos.p.m].a + vpos.p.o].start;
break;