Ticket 48979 - Allow to compile 389ds with warning Wstrict-prototypes
- Remove unused forward declaration
- Remove declaration of errno
The declaration of errno is in the header file errno.h
which is alreadu included in ldap/servers/slapd/agtmmap.h
- Remove explicit casting of db_env_set_func_exists
- Fix casting of db_env_set_func_seek calback
- Fix prototype of str2simple
- Fix prototypes in str2filter.c
ldap/servers/slapd/str2filter.c:22:15: warning: function declaration isn't a prototype [-Wstrict-prototypes]
static struct slapi_filter *str2list();
^~~~~~~~~~~~
ldap/servers/slapd/str2filter.c:23:1: warning: function declaration isn't a prototype [-Wstrict-prototypes]
static int str2subvals();
- Fix prototype vlv_getindexnames
- Fix prototypes in plugins/replication/repl5_prot_private.h
Use exact prototypes for functions Windows_Tot_Protocol_new and
Windows_Inc_Protocol_new
- Fix prototype setup_internal_backends
- Fix prototypes in repl5_prot_private.h
- Fix declaration of get_substring_filter
- Fix declarations in ldap/servers/slapd/filterentry.c
- Prepare for fixing avl_free prototype
The prototyep of the function avl_free is:
"int avl_free(Avlnode *root, IFP dfree);"
and IFP is a typedef for function returning int
with undefined parameters.
This patch definition of callbacks used in function avl_free
to avoid warnings Wincompatible-pointer-types
e.g.
ldap/servers/plugins/roles/roles_cache.c: In function 'roles_cache_role_object_free':
ldap/servers/plugins/roles/roles_cache.c:2145:35: warning: passing argument 2 of 'avl_free' from incompatible pointer type [-Wincompatible-pointer-types]
avl_free(this_role->avl_tree, roles_cache_role_object_nested_free);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ./ldap/servers/slapd/slap.h:113:0,
from ldap/servers/plugins/roles/roles_cache.c:24:
./ldap/include/avl.h:75:13: note: expected 'IFP {aka int (*)()}' but argument is of type 'void (*)(role_object_nested *) {aka void (*)(struct _role_object_nested *)}'
extern int avl_free( Avlnode *root, IFP dfree );
^~~~~~~~
- Use strict prototypes in avl.h
There is a change in definiton of avl_ functions.
The type of data was changed caddr_t into "void *".
This change was necessary because avl_* functions
were used also with other tyes then caddr_t and there
would be compile time warning Wincompatible-pointer-types
There is still one declaration/typedef which is not
prototype. And it is a typedef for callbacks (IFP)
which is used by avl_* functions and cannot have defined
argumets.
- Suppress warnings caused by undefined parameters in IFP
- Suppress Wstrict-prototypes
- Fix warnings Wstrict-prototypes
Functions which does not expect any agumets shoudl be declared with void
as parameter otherwise they can expect any count of arguments.
https://fedorahosted.org/389/ticket/48979
Author: lslebodn
Review by: wibrown (Thanks so much Lukas!)