scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 2e6af0449443b9307aa880883645598ecbc66f86
parent 9af09a076e58a6776b2c0e67c432e316af53790c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Wed,  6 Dec 2017 20:08:18 +0100

Get rid of nothing

Why do you want a /* nothing */ comment when you already
have a ;?

Diffstat:
Mas/parser.c | 2+-
Mcc1/builtin.c | 2+-
Mcc1/cpp.c | 6+++---
Mcc1/decl.c | 4++--
Mcc1/init.c | 2+-
Mcc1/lex.c | 4++--
Mcc1/main.c | 2+-
Mcc2/parser.c | 2+-
Mlib/c/src/strcat.c | 2+-
Mlib/c/src/strcpy.c | 2+-
Mlib/c/src/strcspn.c | 2+-
Mlib/c/src/strlen.c | 2+-
Mlib/c/src/strncmp.c | 2+-
Mlib/c/src/strpbrk.c | 2+-
Mlib/c/src/strspn.c | 2+-
Mlib/c/src/strstr.c | 2+-
Mtests/execute/0132-forward.c | 2+-
17 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/as/parser.c b/as/parser.c @@ -77,7 +77,7 @@ field(char **oldp) break; case '"': while ((c = *++s) && c != '"') - /* nothing */; + ; if (c == '\0') error("unterminated string"); break; diff --git a/cc1/builtin.c b/cc1/builtin.c @@ -70,7 +70,7 @@ builtin_va_start(Symbol *sym) goto error; for (p = curfun->u.pars; p && *p != last->sym; ++p) - /* nothing */; + ; if (!p || *p == NULL || p[1] == NULL || p[1]->type != ellipsistype) warn("second parameter of 'va_start' not last named argument"); diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -204,7 +204,7 @@ copymacro(char *buffer, char *s, size_t bufsiz, char *arglist[]) delim = '"'; search_delim: for (p = s; *++s != delim; ) - /* nothing */; + ; size = s - p + 1; if (size > bufsiz) goto expansion_too_long; @@ -726,7 +726,7 @@ cpp(void) char *p; for (p = input->p; isspace(*p); ++p) - /* nothing */; + ; if (*p != '#') return cppoff; @@ -740,7 +740,7 @@ cpp(void) namespace = NS_IDEN; for (bp = clauses; bp->token && bp->token != yytoken; ++bp) - /* nothing */; + ; if (!bp->token) { errorp("incorrect preprocessor directive '%s'", yytext); goto error; diff --git a/cc1/decl.c b/cc1/decl.c @@ -589,7 +589,7 @@ declarator(struct declarators *dp) for (n = 0; accept('*'); ++n) { while (accept(TQUALIFIER)) - /* nothing */; + ; } directdcl(dp); @@ -928,7 +928,7 @@ dodcl(int rep, Symbol *(*fun)(struct decl *), unsigned ns, Type *parent) declarator(&stack); while (pop(&stack, &dcl)) - /* nothing */; + ; sym = (*fun)(&dcl); if (funbody(sym, dcl.pars)) return sym; diff --git a/cc1/init.c b/cc1/init.c @@ -65,7 +65,7 @@ fielddesig(Type *tp, Init *ip) return 0; } for (p = tp->p.fields; *p != sym; ++p) - /* nothing */; + ; return p - tp->p.fields; } diff --git a/cc1/lex.c b/cc1/lex.c @@ -219,7 +219,7 @@ comment(int type) repeat: while ((c = readchar()) != EOF && c != type) - /* nothing */; + ; if (c == EOF) { errorp("unterminated comment"); @@ -567,7 +567,7 @@ iden(void) begin = input->p; for (p = begin; isalnum(*p) || *p == '_'; ++p) - /* nothing */; + ; input->p = p; tok2str(); if ((sym = lookup(NS_CPP, yytext, NOALLOC)) != NULL) { diff --git a/cc1/main.c b/cc1/main.c @@ -96,7 +96,7 @@ main(int argc, char *argv[]) outcpp(); } else { for (next(); yytoken != EOFTOK; decl()) - /* nothing */; + ; } return failure; diff --git a/cc2/parser.c b/cc2/parser.c @@ -716,7 +716,7 @@ parse(void) endf = 0; while (!endf && nextline()) - /* nothing */; + ; if (ferror(stdin)) error(EFERROR, strerror(errno)); } diff --git a/lib/c/src/strcat.c b/lib/c/src/strcat.c @@ -9,6 +9,6 @@ strcat(char * restrict dst, const char * restrict src) while (*dst) ++dst; while (*dst++ = *src++) - /* nothing */; + ; return ret; } diff --git a/lib/c/src/strcpy.c b/lib/c/src/strcpy.c @@ -7,6 +7,6 @@ strcpy(char * restrict dst, const char * restrict src) char *ret = dst; while (*dst++ = *src++) - /* nothing */; + ; return ret; } diff --git a/lib/c/src/strcspn.c b/lib/c/src/strcspn.c @@ -10,7 +10,7 @@ strcspn(const char *s1, const char *s2) for (n = 0; c = *s1++; ++n) { for (p = s2; *p && *p != c; ++p) - /* nothing */; + ; if (*p == c) break; } diff --git a/lib/c/src/strlen.c b/lib/c/src/strlen.c @@ -7,6 +7,6 @@ strlen(const char *s) const char *t; for (t = s; *t; ++t) - /* nothing */; + ; return t - s; } diff --git a/lib/c/src/strncmp.c b/lib/c/src/strncmp.c @@ -5,6 +5,6 @@ int strncmp(const char *s1, const char *s2, size_t n) { for (; n && *s1 && *s2 && *s1 == *s2; --n, ++s1, ++s2); - /* nothing */; + ; return n ? (*(unsigned char *)s1 - *(unsigned char *)s2) : 0; } diff --git a/lib/c/src/strpbrk.c b/lib/c/src/strpbrk.c @@ -9,7 +9,7 @@ strpbrk(const char *s1, const char *s2) for (; c = *s1; ++s1) { for (p = s2; *p && *p != c; ++p) - /* nothing */; + ; if (*p == c) return s1; } diff --git a/lib/c/src/strspn.c b/lib/c/src/strspn.c @@ -10,7 +10,7 @@ strspn(const char *s1, const char *s2) for (n = 0; c = *s1++; ++n) { for (p = s2; *p && *p != c; ++p) - /* nothing */; + ; if (*p == '\0') break; } diff --git a/lib/c/src/strstr.c b/lib/c/src/strstr.c @@ -17,7 +17,7 @@ strstr(const char *s1, const char *s2) } else { p = s1++; for (q = s2; *q && *s1 == *q; ++s1, ++q) - /* nothing */; + ; if (*q == '\0') return (char *) p; } diff --git a/tests/execute/0132-forward.c b/tests/execute/0132-forward.c @@ -16,6 +16,6 @@ main(void) *x = y; for (n = 0, p = &y; p; ++n, p = p->next) - /* nothing */; + ; return n; }