summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLukas Slebodnik <lslebodn@redhat.com>2017-09-06 07:35:46 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2017-09-06 13:11:45 +0200
commit22abbb479e00438ec4ab19735824cc6e79dd9aaf (patch)
tree5547b0d805938589ed579a6d3c109482dd217944 /src/lib
parentcfe87ca0c4fded9cbf907697d08fa0e6c8f8ebce (diff)
downloadsssd-22abbb479e00438ec4ab19735824cc6e79dd9aaf.tar.gz
sssd-22abbb479e00438ec4ab19735824cc6e79dd9aaf.tar.xz
sssd-22abbb479e00438ec4ab19735824cc6e79dd9aaf.zip
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] Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/certmap/sss_cert_content_nss.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/certmap/sss_cert_content_nss.c b/src/lib/certmap/sss_cert_content_nss.c
index 9b9409797..925124ccd 100644
--- a/src/lib/certmap/sss_cert_content_nss.c
+++ b/src/lib/certmap/sss_cert_content_nss.c
@@ -472,10 +472,16 @@ 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 };
+ /* To avoid 'Wmissing-braces' warnings with older versions of
+ * gcc kerberos_principal_name cannot be initialized with { 0 }
+ * but must be initialized with memset().
+ */
+ 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));