URL: https://github.com/SSSD/sssd/pull/370
Author: lslebodn
 Title: #370: certmap: Suppress warning Wmissing-braces
Action: opened

PR body:
"""
Older version of gcc(e.g. gcc-4.8.5-11.el7) had a false positive warning
with c99 struct initialisation "{ 0 }".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64709

  CC       src/lib/certmap/libsss_certmap_la-sss_cert_content_nss.lo

src/lib/certmap/sss_cert_content_nss.c:
    In function 'add_pkinit_princ_to_san_list':
src/lib/certmap/sss_cert_content_nss.c:475:12:
    error: missing braces around initializer [-Werror=missing-braces]
     struct kerberos_principal_name kname = { 0 };
            ^
src/lib/certmap/sss_cert_content_nss.c:475:12:
    error: (near initialization for 'kname.realm') [-Werror=missing-braces]
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/370/head:pr370
git checkout pr370
From fc7daf4351b40e1390a3059276192d49a19bc49d Mon Sep 17 00:00:00 2001
From: Lukas Slebodnik <lsleb...@redhat.com>
Date: Wed, 6 Sep 2017 07:35:46 +0200
Subject: [PATCH] certmap: Suppress warning Wmissing-braces

Older version of gcc(e.g. gcc-4.8.5-11.el7) had a false positive warning
with c99 struct initialisation "{ 0 }".
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53119
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64709

  CC       src/lib/certmap/libsss_certmap_la-sss_cert_content_nss.lo

src/lib/certmap/sss_cert_content_nss.c:
    In function 'add_pkinit_princ_to_san_list':
src/lib/certmap/sss_cert_content_nss.c:475:12:
    error: missing braces around initializer [-Werror=missing-braces]
     struct kerberos_principal_name kname = { 0 };
            ^
src/lib/certmap/sss_cert_content_nss.c:475:12:
    error: (near initialization for 'kname.realm') [-Werror=missing-braces]
---
 src/lib/certmap/sss_cert_content_nss.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/certmap/sss_cert_content_nss.c b/src/lib/certmap/sss_cert_content_nss.c
index 9b9409797..388ae80d6 100644
--- a/src/lib/certmap/sss_cert_content_nss.c
+++ b/src/lib/certmap/sss_cert_content_nss.c
@@ -472,10 +472,12 @@ static int add_pkinit_princ_to_san_list(TALLOC_CTX *mem_ctx,
 {
     struct san_list *i = NULL;
     SECStatus rv;
-    struct kerberos_principal_name kname = { 0 };
+    struct kerberos_principal_name kname;
     int ret;
     size_t c;
 
+    memset(&kname, 0, sizeof(kname));
+
     rv = SEC_ASN1DecodeItem(pool, &kname,
                             kerberos_principal_name_template,
                             &(current->name.OthName.name));
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to