Hi,
I have made a small patchset to fix some of the GCC warnings. With these patches, I was able to compile dovecot r_1_0_rc26 with the following options:
-Wall -W -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wchar-subscripts -Wformat=2 -Wbad-function-cast Wstrict-prototypes -Wredundant-decls -Wcast-align -Wwrite-strings Wpacked -Winline -Wdisabled-optimization -Wno-long-long -Wundef Wfloat-equal -Wsign-compare -Waggregate-return -Werror
Some of the changes may be arguable, escpecially the const warning fixes, example:
char *pass = "";
I changed that to "pass = NULL" and changed the function call:
- auth_request_verify_plain(request, pass,
- auth_request_verify_plain(request, pass == NULL ? "" : pass,
In other sources, I added "const" to parameters or to the return value where it seemed to make sense and didn't cause harm. Dealing with the const problem can be tricky, and sometimes dirty deconstification hacks are the only way to go.. however I believe we should always turn on "-Wconst" and explicitly add manual deconstitication where we assume it's not dangerous.
I didn't fix all "const" and "missing noreturn" warnings, but my patches may be a good start... if there is further interest in fixing all of them, I'd be glad to do it.
Max