Clang 警告
kilo.c:71:8: warning: padding size of 'struct editorSyntax' with 4 bytes to alignment boundary [-Wpadded] struct editorSyntax { ^kilo.c:106:11: warning: padding struct 'struct editorConfig' with 4 bytes to align 'filename' [-Wpadded] char *filename; /* Currently open filename */kilo.c:85:11: warning: padding struct 'struct erow' with 4 bytes to align 'chars' [-Wpadded] char *chars; /* Row content. */ ^kilo.c:81:16: warning: padding size of 'struct erow' with 4 bytes to alignment boundary [-Wpadded] typedef struct erow {kilo.c:229:20: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] raw.c_iflag &= ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON); ~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~kilo.c:231:20: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] raw.c_oflag &= ~(OPOST);kilo.c:256:21: warning: implicit conversion loses integer precision: 'ssize_t' (aka 'long') to 'int' [-Wshorten-64-to-32] while ((nread = read(fd,&c,1)) == 0);kilo.c:383:36: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] row->hl = realloc(row->hl,row->rsize); ~~~~~~~ ~~~~~^~~~~kilo.c:485:28: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int klen = strlen(keywords[j]);kilo.c:489:43: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] if (!memcmp(p,keywords[j],klen) &&kilo.c:541:26: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int patlen = strlen(s->filematch[i]); ^~~~~~~~~~~~~~~~~~~~~~~kilo.c:573:31: warning: implicit conversion changes signedness: 'int' to 'unsigned int' [-Wsign-conversion] row->render = malloc(row->size + tabs*8 + nonprint*9 + 1);kilo.c:594:50: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] E.row = realloc(E.row,sizeof(erow)*(E.numrows+1)); ~ ~~~~~~~~~^~kilo.c:596:64: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] memmove(E.row+at+1,E.row+at,sizeof(E.row[0])*(E.numrows-at));kilo.c:599:22: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] E.row[at].size = len;kilo.c:627:63: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] memmove(E.row+at,E.row+at+1,sizeof(E.row[0])*(E.numrows-at-1));kilo.c:648:22: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] p = buf = malloc(totlen);kilo.c:667:57: warning: implicit conversion changes signedness: 'int' to 'unsigned long' [-Wsign-conversion] …
内容来源: antirez/kilo