Blob Blame History Raw
From 1b5da030b19e6f7f086ef2f1719159951c574fa7 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 15 Oct 2019 16:49:54 -0400
Subject: [PATCH 50/63] Make: add -Wno-missing-field-initializers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Ritchie wrote in '84:

 If there are fewer initializers in the list than there are members of
 the aggregate, then the aggregate is padded with 0's.

c99 §6.7.8 and c11 §6.7.9 each say:

 10 If an object that has automatic storage duration is not initialized
    explicitly, its value is indeterminate. If an object that has static
    storage duration is not initialized explicitly, then:
    — if it has pointer type, it is initialized to a null pointer;
    — if it has arithmetic type, it is initialized to (positive or
      unsigned) zero;
    — if it is an aggregate, every member is initialized (recursively)
      according to these rules;
    — if it is a union, the first named member is initialized
      (recursively) according to these rules.
...
 21 If there are fewer initializers in a brace-enclosed list than there
    are elements or members of an aggregate, or fewer characters in a
    string literal used to initialize an array of known size than there
    are elements in the array, the remainder of the aggregate shall be
    initialized implicitly the same as objects that have static storage
    duration.

This warning is thoroughly pointless.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 src/include/defaults.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/include/defaults.mk b/src/include/defaults.mk
index df738feddea..af6a41a9824 100644
--- a/src/include/defaults.mk
+++ b/src/include/defaults.mk
@@ -22,6 +22,7 @@ WARNINGS_GCC ?= -Wmaybe-uninitialized \
 WARNINGS_CCC_ANALYZER ?= $(WARNINGS_GCC)
 WARNINGS ?= -Wall -Wextra \
 	    -Wno-address-of-packed-member \
+	    -Wno-missing-field-initializers \
 	    $(call family,WARNINGS)
 ERRORS ?= -Werror -Wno-error=cpp $(call family,ERRORS)
 CPPFLAGS ?=
-- 
2.26.2