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:
@@ -2473,10 +2473,19 @@ krb5_get_init_creds_password(krb5_context context,
|
||||
krb5_prompt prompt;
|
||||
krb5_data password_data;
|
||||
char *p, *q;
|
||||
int aret = -1;
|
||||
|
||||
krb5_unparse_name (context, client, &p);
|
||||
asprintf (&q, "%s's Password: ", p);
|
||||
free (p);
|
||||
ret = krb5_unparse_name (context, client, &p);
|
||||
if (!ret) {
|
||||
aret = asprintf (&q, "%s's Password: ", p);
|
||||
free (p);
|
||||
}
|
||||
if (!ret || aret == -1 || !q) {
|
||||
if (!ret)
|
||||
ret = ENOMEM;
|
||||
krb5_clear_error_message (context);
|
||||
goto out;
|
||||
}
|
||||
prompt.prompt = q;
|
||||
password_data.data = buf;
|
||||
password_data.length = sizeof(buf);
|
||||
|
Reference in New Issue
Block a user