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