]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3/libads: clang: Fix 'Value stored during its initialization is never read'
authorNoel Power <noel.power@suse.com>
Tue, 17 Sep 2019 08:05:28 +0000 (08:05 +0000)
committerJeremy Allison <jra@samba.org>
Thu, 26 Sep 2019 18:41:27 +0000 (18:41 +0000)
Fixes:

source3/libads/ldap.c:370:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:417:11: warning: Value stored to 'status' during its initialization is never read <--[clang]
        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
                 ^~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:1783:13: warning: Value stored to 'ret' during its initialization is never read <--[clang]
        ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
                   ^~~   ~~~~~~~~~~~~~~~~~~~~~~~
source3/libads/ldap.c:1862:13: warning: Value stored to 'ret' during its initialization is never read <--[clang]
        ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
                   ^~~   ~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libads/ldap.c

index 2110390b65fe9f0f6835cb59ceb23bfe3eb35465..6942106a3c327eb2f376ce24c163e6461a8b72e6 100644 (file)
@@ -367,7 +367,7 @@ static NTSTATUS resolve_and_ping_netbios(ADS_STRUCT *ads,
 {
        int count, i;
        struct ip_service *ip_list;
-       NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+       NTSTATUS status;
 
        DEBUG(6, ("resolve_and_ping_netbios: (cldap) looking for domain '%s'\n",
                  domain));
@@ -414,7 +414,7 @@ static NTSTATUS resolve_and_ping_dns(ADS_STRUCT *ads, const char *sitename,
 {
        int count;
        struct ip_service *ip_list = NULL;
-       NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
+       NTSTATUS status;
 
        DEBUG(6, ("resolve_and_ping_dns: (cldap) looking for realm '%s'\n",
                  realm));
@@ -1780,7 +1780,7 @@ uint32_t ads_get_kvno(ADS_STRUCT *ads, const char *account_name)
        char *filter;
        const char *attrs[] = {"msDS-KeyVersionNumber", NULL};
        char *dn_string = NULL;
-       ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
+       ADS_STATUS ret;
 
        DEBUG(5,("ads_get_kvno: Searching for account %s\n", account_name));
        if (asprintf(&filter, "(samAccountName=%s)", account_name) == -1) {
@@ -1859,7 +1859,7 @@ ADS_STATUS ads_clear_service_principal_names(ADS_STRUCT *ads, const char *machin
        LDAPMessage *res = NULL;
        ADS_MODLIST mods;
        const char *servicePrincipalName[1] = {NULL};
-       ADS_STATUS ret = ADS_ERROR(LDAP_SUCCESS);
+       ADS_STATUS ret;
        char *dn_string = NULL;
 
        ret = ads_find_machine_acct(ads, &res, machine_name);