Turn on -Wextra -Wno-sign-compare -Wno-unused-paramter and fix issues.
We turn on a few extra warnings and fix the fallout that occurs when building with --enable-developer. Note that we get different warnings on different machines and so this will be a work in progress. So far, we have built on NetBSD/amd64 5.99.64 (which uses gcc 4.5.3) and Ubuntu 10.04.3 LTS (which uses gcc 4.4.3). Notably, we fixed 1. a lot of missing structure initialisers, 2. unchecked return values for functions that glibc marks as __attribute__((warn-unused-result)), 3. made minor modifications to slc and asn1_compile which can generate code which generates warnings, and 4. a few stragglers here and there. We turned off the extended warnings for many programs in appl/ as they are nearing the end of their useful lifetime, e.g. rsh, rcp, popper, ftp and telnet. Interestingly, glibc's strncmp() macro needed to be worked around whereas the function calls did not. We have not yet tried this on 32 bit platforms, so there will be a few more warnings when we do.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
|
||||
include $(top_srcdir)/Makefile.am.common
|
||||
|
||||
WFLAGS += $(WFLAGS_LITE)
|
||||
|
||||
bin_PROGRAMS = rcp
|
||||
|
||||
rcp_SOURCES = rcp.c util.c rcp_locl.h extern.h
|
||||
|
@@ -58,21 +58,23 @@ static int fflag, tflag;
|
||||
static int version_flag, help_flag;
|
||||
|
||||
struct getargs args[] = {
|
||||
{ NULL, '4', arg_flag, &usekrb4, "use Kerberos 4 authentication" },
|
||||
{ NULL, '5', arg_flag, &usekrb5, "use Kerberos 5 authentication" },
|
||||
{ NULL, 'F', arg_flag, &forwardtkt, "forward credentials" },
|
||||
{ NULL, 'K', arg_flag, &usebroken, "use BSD authentication" },
|
||||
{ NULL, 'P', arg_string, &port, "non-default port", "port" },
|
||||
{ NULL, 'p', arg_flag, &pflag, "preserve file permissions" },
|
||||
{ NULL, 'r', arg_flag, &iamrecursive, "recursive mode" },
|
||||
{ NULL, 'x', arg_flag, &doencrypt, "use encryption" },
|
||||
{ NULL, 'z', arg_flag, &noencrypt, "don't encrypt" },
|
||||
{ NULL, 'd', arg_flag, &targetshouldbedirectory },
|
||||
{ NULL, 'e', arg_flag, &eflag, "passed to rsh" },
|
||||
{ NULL, 'f', arg_flag, &fflag },
|
||||
{ NULL, 't', arg_flag, &tflag },
|
||||
{ "version", 0, arg_flag, &version_flag },
|
||||
{ "help", 0, arg_flag, &help_flag }
|
||||
{ NULL, '4', arg_flag, &usekrb4, "use Kerberos 4 authentication", NULL },
|
||||
{ NULL, '5', arg_flag, &usekrb5, "use Kerberos 5 authentication", NULL },
|
||||
{ NULL, 'F', arg_flag, &forwardtkt, "forward credentials", NULL },
|
||||
{ NULL, 'K', arg_flag, &usebroken, "use BSD authentication",
|
||||
NULL },
|
||||
{ NULL, 'P', arg_string, &port, "non-default port", "port" },
|
||||
{ NULL, 'p', arg_flag, &pflag, "preserve file permissions",
|
||||
NULL },
|
||||
{ NULL, 'r', arg_flag, &iamrecursive, "recursive mode", NULL },
|
||||
{ NULL, 'x', arg_flag, &doencrypt, "use encryption", NULL },
|
||||
{ NULL, 'z', arg_flag, &noencrypt, "don't encrypt", NULL },
|
||||
{ NULL, 'd', arg_flag, &targetshouldbedirectory, NULL, NULL },
|
||||
{ NULL, 'e', arg_flag, &eflag, "passed to rsh", NULL },
|
||||
{ NULL, 'f', arg_flag, &fflag, NULL, NULL },
|
||||
{ NULL, 't', arg_flag, &tflag, NULL, NULL },
|
||||
{ "version", 0, arg_flag, &version_flag, NULL, NULL },
|
||||
{ "help", 0, arg_flag, &help_flag, NULL, NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user