mirror of
git://git.gnupg.org/gnupg.git
synced 2025-02-22 19:58:29 +01:00
dirmngr,w32: Silence compiler warnings for the LDAP API.
--
This commit is contained in:
parent
dfc01118ce
commit
cc1d475f98
@ -747,7 +747,7 @@ print_ldap_entries (LDAP *ld, LDAPMessage *msg, char *want_attr)
|
||||
|
||||
/* Fetch data from the server at LD using FILTER. */
|
||||
static int
|
||||
fetch_ldap (LDAP *ld, const char *base, int scope, const char *filter)
|
||||
fetch_ldap (LDAP *ld, char *base, int scope, char *filter)
|
||||
{
|
||||
gpg_error_t err;
|
||||
int lerr;
|
||||
|
@ -544,8 +544,13 @@ my_ldap_connect (parsed_uri_t uri, LDAP **ldap_connp,
|
||||
}
|
||||
else if (bindname)
|
||||
{
|
||||
|
||||
npth_unprotect ();
|
||||
lerr = ldap_simple_bind_s (ldap_conn, bindname, password);
|
||||
/* Older Windows header dont have the const for the last two args.
|
||||
* Thus we need to cast to avoid warnings. */
|
||||
lerr = ldap_simple_bind_s (ldap_conn,
|
||||
(char * const)bindname,
|
||||
(char * const)password);
|
||||
npth_protect ();
|
||||
if (lerr != LDAP_SUCCESS)
|
||||
{
|
||||
|
@ -100,6 +100,25 @@ void ldap_pvt_hex_unescape( char *s );
|
||||
# define LDAP_SCOPE_DEFAULT -1
|
||||
#endif
|
||||
|
||||
#if __GNUC__
|
||||
# define MY_GCC_VERSION (__GNUC__ * 10000 \
|
||||
+ __GNUC_MINOR__ * 100 \
|
||||
+ __GNUC_PATCHLEVEL__)
|
||||
#else
|
||||
# define MY_GCC_VERSION 0
|
||||
#endif
|
||||
|
||||
|
||||
/* Avoid warnings about strncpy usage. */
|
||||
#if MY_GCC_VERSION >= 80000
|
||||
# pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||
# pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||
#elif defined __clang__
|
||||
# pragma clang diagnostic ignored "-Wstringop-truncation"
|
||||
# pragma clang diagnostic ignored "-Wstringop-overflow"
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/* $OpenLDAP: pkg/ldap/libraries/libldap/charray.c,v 1.9.2.2 2003/03/03 17:10:04 kurt Exp $ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user