Blame SOURCES/0050-Make-add-Wno-missing-field-initializers.patch

4e0e09
From 1b5da030b19e6f7f086ef2f1719159951c574fa7 Mon Sep 17 00:00:00 2001
4e0e09
From: Peter Jones <pjones@redhat.com>
4e0e09
Date: Tue, 15 Oct 2019 16:49:54 -0400
4e0e09
Subject: [PATCH 50/63] Make: add -Wno-missing-field-initializers
4e0e09
MIME-Version: 1.0
4e0e09
Content-Type: text/plain; charset=UTF-8
4e0e09
Content-Transfer-Encoding: 8bit
4e0e09
4e0e09
Ritchie wrote in '84:
4e0e09
4e0e09
 If there are fewer initializers in the list than there are members of
4e0e09
 the aggregate, then the aggregate is padded with 0's.
4e0e09
4e0e09
c99 §6.7.8 and c11 §6.7.9 each say:
4e0e09
4e0e09
 10 If an object that has automatic storage duration is not initialized
4e0e09
    explicitly, its value is indeterminate. If an object that has static
4e0e09
    storage duration is not initialized explicitly, then:
4e0e09
    — if it has pointer type, it is initialized to a null pointer;
4e0e09
    — if it has arithmetic type, it is initialized to (positive or
4e0e09
      unsigned) zero;
4e0e09
    — if it is an aggregate, every member is initialized (recursively)
4e0e09
      according to these rules;
4e0e09
    — if it is a union, the first named member is initialized
4e0e09
      (recursively) according to these rules.
4e0e09
...
4e0e09
 21 If there are fewer initializers in a brace-enclosed list than there
4e0e09
    are elements or members of an aggregate, or fewer characters in a
4e0e09
    string literal used to initialize an array of known size than there
4e0e09
    are elements in the array, the remainder of the aggregate shall be
4e0e09
    initialized implicitly the same as objects that have static storage
4e0e09
    duration.
4e0e09
4e0e09
This warning is thoroughly pointless.
4e0e09
4e0e09
Signed-off-by: Peter Jones <pjones@redhat.com>
4e0e09
---
4e0e09
 src/include/defaults.mk | 1 +
4e0e09
 1 file changed, 1 insertion(+)
4e0e09
4e0e09
diff --git a/src/include/defaults.mk b/src/include/defaults.mk
4e0e09
index df738feddea..af6a41a9824 100644
4e0e09
--- a/src/include/defaults.mk
4e0e09
+++ b/src/include/defaults.mk
4e0e09
@@ -22,6 +22,7 @@ WARNINGS_GCC ?= -Wmaybe-uninitialized \
4e0e09
 WARNINGS_CCC_ANALYZER ?= $(WARNINGS_GCC)
4e0e09
 WARNINGS ?= -Wall -Wextra \
4e0e09
 	    -Wno-address-of-packed-member \
4e0e09
+	    -Wno-missing-field-initializers \
4e0e09
 	    $(call family,WARNINGS)
4e0e09
 ERRORS ?= -Werror -Wno-error=cpp $(call family,ERRORS)
4e0e09
 CPPFLAGS ?=
4e0e09
-- 
4e0e09
2.26.2
4e0e09