Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
scc warns
pair:scc pancake$ make
scc build options:
CFLAGS = -std=c99
LDFLAGS = -s
CC = cc
cc -c -o die.o die.c
cc -c -o xcalloc.o xcalloc.c
cc -c -o xmalloc.o xmalloc.c
cc -c -o xrealloc.o xrealloc.c
cc -c -o xstrdup.o xstrdup.c
ar r libcc.a die.o xcalloc.o xmalloc.o xrealloc.o xstrdup.o
ar: creating archive libcc.a
cc -std=c99 -c -o types.o types.c
types.c:267:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
types.c:295:16: warning: '&&' within '||' [-Wlogical-op-parentheses]
if (op == ARY && nelem == 0 || op == STRUCT || op == UNION)
~~~~~~~~~~^~~~~~~~~~~~~ ~~
types.c:295:16: note: place parentheses around the '&&' expression to silence this warning
if (op == ARY && nelem == 0 || op == STRUCT || op == UNION)
^
( )
2 warnings generated.
cc -std=c99 -c -o decl.o decl.c
decl.c:268:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
1 warning generated.
cc -std=c99 -c -o lex.o lex.c
lex.c:246:23: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (p = input->p; c = *p; ++p) {
~~^~~~
lex.c:246:23: note: place parentheses around the assignment to silence this warning
for (p = input->p; c = *p; ++p) {
^
( )
lex.c:246:23: note: use '==' to turn this assignment into an equality comparison
for (p = input->p; c = *p; ++p) {
^
==
lex.c:456:8: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (c = *input->p != '.')
~~^~~~~~~~~~~~~~~~~~
lex.c:456:8: note: place parentheses around the assignment to silence this warning
if (c = *input->p != '.')
^
( )
lex.c:456:8: note: use '==' to turn this assignment into an equality comparison
if (c = *input->p != '.')
^
==
2 warnings generated.
cc -std=c99 -c -o error.o error.c
cc -std=c99 -c -o symbol.o symbol.c
symbol.c:30:25: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
fprintf(stderr, "%d", bp - htab);
~~ ^~~~~~~~~
%ld
symbol.c:43:16: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (h = 0; c = *s; ++s)
~~^~~~
symbol.c:43:16: note: place parentheses around the assignment to silence this warning
for (h = 0; c = *s; ++s)
^
( )
symbol.c:43:16: note: use '==' to turn this assignment into an equality comparison
for (h = 0; c = *s; ++s)
^
==
2 warnings generated.
cc -std=c99 -c -o main.o main.c
cc -std=c99 -c -o expr.o expr.c
expr.c:97:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
expr.c:192:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
expr.c:351:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
expr.c:439:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
expr.c:455:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
5 warnings generated.
cc -std=c99 -c -o code.o code.c
code.c:199:25: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (bp = sym->u.s; c = *bp; ++bp)
~~^~~~~
code.c:199:25: note: place parentheses around the assignment to silence this warning
for (bp = sym->u.s; c = *bp; ++bp)
^
( )
code.c:199:25: note: use '==' to turn this assignment into an equality comparison
for (bp = sym->u.s; c = *bp; ++bp)
^
==
code.c:204:3: warning: expression result unused [-Wunused-value]
abort;
^~~~~
2 warnings generated.
cc -std=c99 -c -o stmt.o stmt.c
cc -std=c99 -c -o cpp.o cpp.c
cpp.c:154:23: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (prevc = '\0'; c = *s; prevc = c, ++s) {
~~^~~~
cpp.c:154:23: note: place parentheses around the assignment to silence this warning
for (prevc = '\0'; c = *s; prevc = c, ++s) {
^
( )
cpp.c:154:23: note: use '==' to turn this assignment into an equality comparison
for (prevc = '\0'; c = *s; prevc = c, ++s) {
^
==
cpp.c:186:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
cpp.c:269:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
cpp.c:287:31: warning: format specifies type 'int' but the argument has type 'long' [-Wformat]
sprintf(yytext, "@%02d@", argp - args);
~~~~ ^~~~~~~~~~~
%02ld
/usr/include/secure/_stdio.h:47:56: note: expanded from macro 'sprintf'
__builtin___sprintf_chk (str, 0, __darwin_obsz(str), __VA_ARGS__)
^
4 warnings generated.
cc -s types.o decl.o lex.o error.o symbol.o main.o expr.o code.o stmt.o cpp.o ../lib/libcc.a -o cc1
ld: warning: option -s is obsolete and being ignored
rm -f error.h; trap 'rm -f $$.h' EXIT INT QUIT
awk -f generror cc2.h > $$.h && mv $$.h error.h
cc -std=c99 -c -o main.o main.c
cc -std=c99 -c -o parser.o parser.c
parser.c:171:35: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (list = curfun->u.f.body; np = *list; ++list)
~~~^~~~~~~
parser.c:171:35: note: place parentheses around the assignment to silence this warning
for (list = curfun->u.f.body; np = *list; ++list)
^
( )
parser.c:171:35: note: use '==' to turn this assignment into an equality comparison
for (list = curfun->u.f.body; np = *list; ++list)
^
==
parser.c:285:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
parser.c:433:17: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
} while (token = strtok(NULL, "\t"));
~~~~~~^~~~~~~~~~~~~~~~~~~~
parser.c:433:17: note: place parentheses around the assignment to silence this warning
} while (token = strtok(NULL, "\t"));
^
( )
parser.c:433:17: note: use '==' to turn this assignment into an equality comparison
} while (token = strtok(NULL, "\t"));
^
==
parser.c:461:12: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (token = strtok(NULL, "\t")) {
~~~~~~^~~~~~~~~~~~~~~~~~~~
parser.c:461:12: note: place parentheses around the assignment to silence this warning
if (token = strtok(NULL, "\t")) {
^
( )
parser.c:461:12: note: use '==' to turn this assignment into an equality comparison
if (token = strtok(NULL, "\t")) {
^
==
4 warnings generated.
cc -std=c99 -c -o cgen.o cgen.c
cgen.c:107:19: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (bp = ary; c = *bp; ++bp) {
~~^~~~~
cgen.c:107:19: note: place parentheses around the assignment to silence this warning
for (bp = ary; c = *bp; ++bp) {
^
( )
cgen.c:107:19: note: use '==' to turn this assignment into an equality comparison
for (bp = ary; c = *bp; ++bp) {
^
==
cgen.c:237:10: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
if (sym = np->sym)
~~~~^~~~~~~~~
cgen.c:237:10: note: place parentheses around the assignment to silence this warning
if (sym = np->sym)
^
( )
cgen.c:237:10: note: use '==' to turn this assignment into an equality comparison
if (sym = np->sym)
^
==
cgen.c:529:35: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
for (stmt = curfun->u.f.body; np = *stmt; ++stmt)
~~~^~~~~~~
cgen.c:529:35: note: place parentheses around the assignment to silence this warning
for (stmt = curfun->u.f.body; np = *stmt; ++stmt)
^
( )
cgen.c:529:35: note: use '==' to turn this assignment into an equality comparison
for (stmt = curfun->u.f.body; np = *stmt; ++stmt)
^
==
3 warnings generated.
cc -std=c99 -c -o code.o code.c
cc -std=c99 -c -o optm.o optm.c
cc -std=c99 -c -o peep.o peep.c
cc -s main.o parser.o cgen.o code.o optm.o peep.o ../lib/libcc.a -o cc2
ld: warning: option -s is obsolete and being ignored
pair:scc pancake$
sh: 2 (0.04%)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment