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