Discussion:
[PATCH] ofnet: fix build regression in grub_ieee1275_parse_bootpath
(too old to reply)
Eric Snowberg
2018-11-27 23:17:26 UTC
Permalink
The grub_ieee1275_parse_bootpath function (commit a661a32, ofnet: Initialize
structs in bootpath parser.) introduces a build regression on SPARC:

cc1: warnings being treated as errors
net/drivers/ieee1275/ofnet.c: In function 'grub_ieee1275_parse_bootpath':
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'client_addr.type')
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'gateway_addr.type')
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'subnet_mask.type')
net/drivers/ieee1275/ofnet.c:157: error: missing initializer
net/drivers/ieee1275/ofnet.c:157: error: (near initialization for 'hw_addr.type')
make[3]: *** [net/drivers/ieee1275/ofnet_module-ofnet.o] Error 1

Initialize the entire structure.

Signed-off-by: Eric Snowberg <***@oracle.com>
---
Ref: http://lists.gnu.org/archive/html/grub-devel/2018-03/msg00034.html
---
grub-core/net/drivers/ieee1275/ofnet.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/grub-core/net/drivers/ieee1275/ofnet.c b/grub-core/net/drivers/ieee1275/ofnet.c
index 00abc64..856e88b 100644
--- a/grub-core/net/drivers/ieee1275/ofnet.c
+++ b/grub-core/net/drivers/ieee1275/ofnet.c
@@ -153,8 +153,8 @@ grub_ieee1275_parse_bootpath (const char *devpath, char *bootpath,
char *comma_char = 0;
char *equal_char = 0;
grub_size_t field_counter = 0;
- grub_net_network_level_address_t client_addr = {}, gateway_addr = {}, subnet_mask = {};
- grub_net_link_level_address_t hw_addr = {};
+ grub_net_network_level_address_t client_addr = {0,{0},0}, gateway_addr = {0,{0},0}, subnet_mask = {0,{0},0};
+ grub_net_link_level_address_t hw_addr = {0,{{0,0,0,0,0,0}}};
grub_net_interface_flags_t flags = 0;
struct grub_net_network_level_interface *inter = NULL;
grub_uint16_t vlantag = 0;
--
1.7.1
Daniel Kiper
2018-11-28 12:58:30 UTC
Permalink
Post by Eric Snowberg
The grub_ieee1275_parse_bootpath function (commit a661a32, ofnet: Initialize
cc1: warnings being treated as errors
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'client_addr.type')
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'gateway_addr.type')
net/drivers/ieee1275/ofnet.c:156: error: missing initializer
net/drivers/ieee1275/ofnet.c:156: error: (near initialization for 'subnet_mask.type')
net/drivers/ieee1275/ofnet.c:157: error: missing initializer
net/drivers/ieee1275/ofnet.c:157: error: (near initialization for 'hw_addr.type')
make[3]: *** [net/drivers/ieee1275/ofnet_module-ofnet.o] Error 1
Initialize the entire structure.
Pushed with minor changes. Thanks!

Daniel

Continue reading on narkive:
Loading...