[tor-dev] [patch] fix cparser/firm compiler warnings

Christian Grothoff christian at grothoff.org
Sun Oct 14 09:03:00 UTC 2012


We're trying to compile Tor with cparser and got some warnings and an

src/or/dirserv.c:803:1: error: declaration 'was_router_added_t
dirserv_add_extrainfo(extrainfo_t*, const char**)' is incompatible with
'int dirserv_add_extrainfo(extrainfo_t*, const char**)' (declared at
line 96:12)
src/or/dirserv.c:81:14: warning: unnecessary static forward declaration
for 'char* format_versions_list(config_line_t*)' [-Wredundant-decls]
src/or/dirserv.c:2186:8: warning: statement is empty [-Wempty-statement]
src/or/dirserv.c:2210:8: warning: statement is empty [-Wempty-statement]
src/or/dirserv.c:2752:51: warning: statement is empty
src/or/dirserv.c:3009:51: warning: statement is empty
src/or/dirserv.c:3280:112: warning: statement is empty
src/or/dirserv.c:3483:54: warning: statement is empty
src/or/dirserv.c:3603:129: warning: statement is empty
1 error(s), 47 warning(s)

The attached patch fixes those the warnings that are unambiguously due
to inconsistent style ("if (cond) {body};" -- removing extra semicolon)
and fixes the warning due to inconsistently declared a return type (once
declared as 'enum', once as 'int').

Is there a better place for sending patches that do not really require
broad discussion?

Happy hacking!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-compiler-warnings.diff
Type: text/x-diff
Size: 1303 bytes
Desc: not available
URL: <http://lists.torproject.org/pipermail/tor-dev/attachments/20121014/a9aadf8d/attachment.diff>

More information about the tor-dev mailing list