Since CL
115060044, mkanames declares an empty
array in anames8.c and anames6.c, which is not
valid for the Plan 9 compiler.
char* cnames8[] = {
};
This change makes mkanames not declaring the
cnames array when no C_ constants are found.
LGTM=iant
R=minux, iant
CC=golang-codereviews
https://golang.org/cl/
117680043
void
mkanames(char *dir, char *file)
{
- int i, ch;
+ int i, j, ch;
Buf in, b, out, out2;
Vec lines;
char *p;
}
bwritestr(&out, "};\n");
+ j=0;
bprintf(&out2, "char* cnames%c[] = {\n", ch);
for(i=0; i<lines.len; i++) {
if(hasprefix(lines.p[i], "\tC_")) {
*p = '\0';
p = lines.p[i] + 3;
bwritestr(&out2, bprintf(&b, "\t\"%s\",\n", p));
+ j++;
}
}
bwritestr(&out2, "};\n");
- bwriteb(&out, &out2);
+ if(j>0)
+ bwriteb(&out, &out2);
writefile(&out, file, 0);