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:
@@ -51,7 +51,7 @@ range_entry_cmp(const void *a, const void *b)
|
||||
static int
|
||||
is_ral(uint32_t cp)
|
||||
{
|
||||
struct range_entry ee = {cp};
|
||||
struct range_entry ee = {cp, 0};
|
||||
void *s = bsearch(&ee, _wind_ral_table, _wind_ral_table_size,
|
||||
sizeof(_wind_ral_table[0]),
|
||||
range_entry_cmp);
|
||||
@@ -61,7 +61,7 @@ is_ral(uint32_t cp)
|
||||
static int
|
||||
is_l(uint32_t cp)
|
||||
{
|
||||
struct range_entry ee = {cp};
|
||||
struct range_entry ee = {cp, 0};
|
||||
void *s = bsearch(&ee, _wind_l_table, _wind_l_table_size,
|
||||
sizeof(_wind_l_table[0]),
|
||||
range_entry_cmp);
|
||||
|
@@ -49,7 +49,7 @@ translation_cmp(const void *key, const void *data)
|
||||
int
|
||||
_wind_combining_class(uint32_t code_point)
|
||||
{
|
||||
struct translation ts = {code_point};
|
||||
struct translation ts = {code_point, 0};
|
||||
void *s = bsearch(&ts, _wind_combining_table, _wind_combining_table_size,
|
||||
sizeof(_wind_combining_table[0]),
|
||||
translation_cmp);
|
||||
|
@@ -51,7 +51,7 @@ error_entry_cmp(const void *a, const void *b)
|
||||
int
|
||||
_wind_stringprep_error(const uint32_t cp, wind_profile_flags flags)
|
||||
{
|
||||
struct error_entry ee = {cp};
|
||||
struct error_entry ee = {cp, 0, 0};
|
||||
const struct error_entry *s;
|
||||
|
||||
s = (const struct error_entry *)
|
||||
|
@@ -58,7 +58,7 @@ _wind_stringprep_map(const uint32_t *in, size_t in_len,
|
||||
unsigned o = 0;
|
||||
|
||||
for (i = 0; i < in_len; ++i) {
|
||||
struct translation ts = {in[i]};
|
||||
struct translation ts = {in[i], 0, 0, 0};
|
||||
const struct translation *s;
|
||||
|
||||
s = (const struct translation *)
|
||||
|
@@ -127,7 +127,7 @@ compat_decomp(const uint32_t *in, size_t in_len,
|
||||
unsigned o = 0;
|
||||
|
||||
for (i = 0; i < in_len; ++i) {
|
||||
struct translation ts = {in[i]};
|
||||
struct translation ts = {in[i], 0, 0};
|
||||
size_t sub_len = *out_len - o;
|
||||
int ret;
|
||||
|
||||
|
@@ -47,7 +47,7 @@
|
||||
static size_t
|
||||
parse_vector(char *buf, uint32_t *v)
|
||||
{
|
||||
char *last;
|
||||
char *last = NULL;
|
||||
unsigned ret = 0;
|
||||
const char *n;
|
||||
unsigned u;
|
||||
|
@@ -78,24 +78,24 @@ struct testcase {
|
||||
};
|
||||
|
||||
static const struct testcase testcases[] = {
|
||||
{"", 0, {0}},
|
||||
{"\x01", 1, {1}},
|
||||
{"\x7F", 1, {0x7F}},
|
||||
{"\x01\x7F", 2, {0x01, 0x7F}},
|
||||
{"\xC0\x80", 1, {0}},
|
||||
{"\xC0\x81", 1, {1}},
|
||||
{"\xC1\x80", 1, {0x40}},
|
||||
{"\xDF\xBF", 1, {0x7FF}},
|
||||
{"\xE0\x80\x80", 1, {0}},
|
||||
{"\xE0\x80\x81", 1, {1}},
|
||||
{"\xE0\x81\x80", 1, {0x40}},
|
||||
{"\xE1\x80\x80", 1, {0x1000}},
|
||||
{"\xEF\xBF\xBF", 1, {0xFFFF}},
|
||||
{"\xF0\x80\x80\x80", 1, {0}},
|
||||
{"\xF0\x80\x80\x81", 1, {1}},
|
||||
{"\xF0\x80\x81\x80", 1, {0x40}},
|
||||
{"\xF0\x81\x80\x80", 1, {0x1000}},
|
||||
{"\xF1\x80\x80\x80", 1, {0x40000}},
|
||||
{"", 0, {0}, 0},
|
||||
{"\x01", 1, {1}, 0},
|
||||
{"\x7F", 1, {0x7F}, 0},
|
||||
{"\x01\x7F", 2, {0x01, 0x7F}, 0},
|
||||
{"\xC0\x80", 1, {0}, 0},
|
||||
{"\xC0\x81", 1, {1}, 0},
|
||||
{"\xC1\x80", 1, {0x40}, 0},
|
||||
{"\xDF\xBF", 1, {0x7FF}, 0},
|
||||
{"\xE0\x80\x80", 1, {0}, 0},
|
||||
{"\xE0\x80\x81", 1, {1}, 0},
|
||||
{"\xE0\x81\x80", 1, {0x40}, 0},
|
||||
{"\xE1\x80\x80", 1, {0x1000}, 0},
|
||||
{"\xEF\xBF\xBF", 1, {0xFFFF}, 0},
|
||||
{"\xF0\x80\x80\x80", 1, {0}, 0},
|
||||
{"\xF0\x80\x80\x81", 1, {1}, 0},
|
||||
{"\xF0\x80\x81\x80", 1, {0x40}, 0},
|
||||
{"\xF0\x81\x80\x80", 1, {0x1000}, 0},
|
||||
{"\xF1\x80\x80\x80", 1, {0x40000}, 0},
|
||||
{"\xF7\xBF\xBF\xBF", 1, {0X1FFFFF}, 1},
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user